Easy A
Would you like to react to this message? Create an account in a few clicks or log in to continue.


 
HomeHome  Latest imagesLatest images  SearchSearch  RegisterRegister  Log inLog in  

Share
 

 Seeing If File Is Audio

View previous topic View next topic Go down 
AuthorMessage
Twerk
Member
Member
Twerk

Posts : 26
Join date : 2011-04-17

Seeing If File Is Audio Empty
PostSubject: Seeing If File Is Audio   Seeing If File Is Audio EmptySat Dec 10, 2011 6:06 am

I just wanted to be able to detirmine if the file that the user selected out of an OpenFileDialog is an audio file (mp3, mp4, wav, etc.)

I know that I can just use the filter property with the OpenFileDialog box, but I'm sure that there must be an easier way to validate the file the user chose and see if it's an audio file.

I hope I explained myself well...

Thanks in advance!


Last edited by Twerk on Sat Dec 10, 2011 6:11 am; edited 1 time in total
Back to top Go down
Abstract
Member
Member
Abstract

Posts : 3
Join date : 2011-07-05

Seeing If File Is Audio Empty
PostSubject: Re: Seeing If File Is Audio   Seeing If File Is Audio EmptySat Dec 10, 2011 6:07 am

An easier way then then writing in the properties ".mp3", ".wav", ".wma" etc....

How can you get any easier?
Back to top Go down
Twerk
Member
Member
Twerk

Posts : 26
Join date : 2011-04-17

Seeing If File Is Audio Empty
PostSubject: Re: Seeing If File Is Audio   Seeing If File Is Audio EmptySat Dec 10, 2011 6:07 am

Well....i guess that is pretty easy to do...

But basically what I want to achieve is getting something like the image in the attachment.

(the program is WIndows Movie Maker)

[You must be registered and logged in to see this image.]
Back to top Go down
Abstract
Member
Member
Abstract

Posts : 3
Join date : 2011-07-05

Seeing If File Is Audio Empty
PostSubject: Re: Seeing If File Is Audio   Seeing If File Is Audio EmptySat Dec 10, 2011 6:08 am

It's still filtered on it's own in built list.
Back to top Go down
Twerk
Member
Member
Twerk

Posts : 26
Join date : 2011-04-17

Seeing If File Is Audio Empty
PostSubject: Re: Seeing If File Is Audio   Seeing If File Is Audio EmptySat Dec 10, 2011 6:08 am

So do you know if there is a way to try doing something similar?

I tried:
Code:

OpenFileDialog.Filter = "Audio Files|*.wav, *.mp3, *.wma"

But that didn't work...

Sorry if I'm bugging you a little, but do you know anything?
Back to top Go down
Jervyn
Member
Member
Jervyn

Posts : 6
Join date : 2011-06-21

Seeing If File Is Audio Empty
PostSubject: Re: Seeing If File Is Audio   Seeing If File Is Audio EmptySat Dec 10, 2011 6:09 am

Twerk wrote:
So do you know if there is a way to try doing something similar?

I tried:
Code:

OpenFileDialog.Filter = "Audio Files|*.wav, *.mp3, *.wma"

But that didn't work...

Sorry if I'm bugging you a little, but do you know anything?

Use a semicolon instead of comma,

e.g. .Filter = "Image Files|*.jpg;*.gif;*.bmp;*.png|All Files|*.*"
Back to top Go down
Twerk
Member
Member
Twerk

Posts : 26
Join date : 2011-04-17

Seeing If File Is Audio Empty
PostSubject: Re: Seeing If File Is Audio   Seeing If File Is Audio EmptySat Dec 10, 2011 6:10 am

Thanks so much Jervyn! It worked perfectly. Thank you ident for your help.
Back to top Go down
Sponsored content




Seeing If File Is Audio Empty
PostSubject: Re: Seeing If File Is Audio   Seeing If File Is Audio Empty

Back to top Go down
 

Seeing If File Is Audio

View previous topic View next topic Back to top 
Page 1 of 1

 Similar topics

-
» C: Read from file and write to file
» Live steaming audio
» help with function to play audio
» file size help
» Please help - Dom Parsing XML file to HTML?

Permissions in this forum:You cannot reply to topics in this forum
Easy A :: Seeing If File Is Audio Edit-trash Useless :: Trash-