|
-
Jul 28th, 2006, 05:59 PM
#1
Thread Starter
Hyperactive Member
Sound Api
Hi all,
I was just looking at the Api Guide. I realised there are only two API functions to play .wav sound files. I was wondering if there was Api functions to play other sound files. If not, how can I play such sound files.
Notel: I don't want music player examples cuz i want to create my own music player.
Khanjan
Hey... If you found this post helpful please rate it.

-
Jul 28th, 2006, 06:05 PM
#2
Re: Sound Api
Which "other sound files"? Mid? mp3? wma?
-
Jul 28th, 2006, 07:29 PM
#3
Thread Starter
Hyperactive Member
Re: Sound Api
Well i would want both mp3 and wma. I am not sure if there are other commonly used sound files. But it would be good if I could get some sort of help on playing the common sound files.
I am sure we can be able to detect with sort of sound file it is and then we can play it using the specific function for that particular file.
I am sorry but it does seem like too much to ask for but I can't help it.
Thanx for your help in advance anyways
Khanjan
Hey... If you found this post helpful please rate it.

-
Jul 28th, 2006, 08:44 PM
#4
Re: Sound Api
This could be a good example of a player that doesnt use the Windows Media Player Ocx, it has a reference to the Active Movie Library to play files but the player itself has been created in the Form, maybe you could do something like this. Another advantage: it plays mp3, mid, wma..
About this library (Active movie), i think is ditributed with all versions of WinXP, but im not sure about previous OSs.
-
Jul 29th, 2006, 02:40 AM
#5
Re: Sound Api
Which 2 APIs do you mean ? PlaySound and snsPlaySound ? There is another one - mciSendString. It's not the easiest of APIs to use, as you have to put the parameters in a string, rather than the comma delimited values you'd expect from an API. (it's confusing!). But it will play a variety of audio and video files as long as the codecs *it likes* are installed. If you take a look at a little app I put in the codebank VB - mciSendString - audio/video playback / video splashscreen etc from resource file, it will give you an idea of what can be done. It does have (coding) drawbacks, for example:-
1) It doesn't like long file names, particularly with spaces - so you have to do a little more work to get it to run properly.
2) It won't run files from memory, like PlaySound, so you have to create temporary files if you've put your media in a resource or data file.
There are other annoyances, but that's all they are.
The upside is you don't need any OCXs - even to play videos. It's limits are the physical capabilities of the PC you're using it on.
-
Jul 29th, 2006, 09:29 PM
#6
Thread Starter
Hyperactive Member
Re: Sound Api
Thanx you all,
I will take a look at your examples and if I have any further questions, I will post questions.
Khanjan
Hey... If you found this post helpful please rate it.

Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|