Results 1 to 6 of 6

Thread: Sound Api

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2005
    Location
    Toronto, Canada
    Posts
    357

    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.

  2. #2
    PowerPoster jcis's Avatar
    Join Date
    Jan 2003
    Location
    Argentina
    Posts
    4,430

    Re: Sound Api

    Which "other sound files"? Mid? mp3? wma?

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2005
    Location
    Toronto, Canada
    Posts
    357

    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.

  4. #4
    PowerPoster jcis's Avatar
    Join Date
    Jan 2003
    Location
    Argentina
    Posts
    4,430

    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.

  5. #5
    Fanatic Member schoolbusdriver's Avatar
    Join Date
    Jan 2006
    Location
    O'er yonder
    Posts
    1,020

    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.

  6. #6

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2005
    Location
    Toronto, Canada
    Posts
    357

    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
  •  



Click Here to Expand Forum to Full Width