Results 1 to 18 of 18

Thread: [RESOLVED] Wave Files and Vista. Some working and some not working. Strange.

  1. #1

    Thread Starter
    Hyperactive Member Hassan Basri's Avatar
    Join Date
    Sep 2006
    Posts
    324

    Resolved [RESOLVED] Wave Files and Vista. Some working and some not working. Strange.

    Hello everybody,

    I have an application with embedded in the ressource file wave files. I use PlaySound to play them. This works perfectly up to Windows Xp.

    Recently I have a friend testing the application on Vista. Certain files are not playing, and others are.

    Any ideas why some would play and some wouldn't? It seems very strange.

    Here is the code. It works for some wave files and not others

    VB Code:
    1. Call PlaySound("MY_EMBEDDED_WAVE_FILE", App.hInstance, SND_RESOURCE Or SND_NOWAIT Or SND_NODEFAULT Or SND_ASYNC)
    Last edited by Hassan Basri; Feb 24th, 2007 at 09:03 AM.

  2. #2
    "Digital Revolution"
    Join Date
    Mar 2005
    Posts
    4,471

    Re: Wave Files and Vista. Some working and some not working. Strange.

    Can't say for sure, never used Vista.

    What are the sample-rate/bit-depths of the WAV files?

    ie: 44100 sample rate, 16-bit.

    Also are they mono or stereo?

  3. #3

    Thread Starter
    Hyperactive Member Hassan Basri's Avatar
    Join Date
    Sep 2006
    Posts
    324

    Re: Wave Files and Vista. Some working and some not working. Strange.

    Does that make a difference?

    This is one that is not working:

    Bit Rate: 20kbps
    Channels: 1 (mono)
    Audio sample rate: 11kHz
    Audio Format: MPEG Layer-3

    This is one that is working:

    Bit Rate: 20kbps
    Audio sample siz: 8 bit
    Channels: 1 (mono)
    Audio sample rate: 11kHz
    Audio Format: PCM

  4. #4
    "Digital Revolution"
    Join Date
    Mar 2005
    Posts
    4,471

    Re: Wave Files and Vista. Some working and some not working. Strange.

    Quote Originally Posted by Hassan Basri
    Does that make a difference?

    This is one that is not working:

    Bit Rate: 20kbps
    Channels: 1 (mono)
    Audio sample rate: 11kHz
    Audio Format: MPEG Layer-3

    This is one that is working:

    Bit Rate: 20kbps
    Audio sample siz: 8 bit
    Channels: 1 (mono)
    Audio sample rate: 11kHz
    Audio Format: PCM
    Possible problem is that it is an MP3 and not a WAV.

    That's the only thing I can think of since I haven't tried Vista.

    Can you post the block of code where the SndPlaySound is called for the file that isn't working?

  5. #5

    Thread Starter
    Hyperactive Member Hassan Basri's Avatar
    Join Date
    Sep 2006
    Posts
    324

    Re: Wave Files and Vista. Some working and some not working. Strange.

    However in all other windows versions up to XP all these files work perfectly. That is why I am surprised.

    The code for both working and not working is like this:

    VB Code:
    1. Call PlaySound("MY_EMBEDDED_WAVE_FILE", App.hInstance, SND_RESOURCE Or SND_NOWAIT Or SND_NODEFAULT Or SND_ASYNC)

  6. #6
    "Digital Revolution"
    Join Date
    Mar 2005
    Posts
    4,471

    Re: Wave Files and Vista. Some working and some not working. Strange.

    Quote Originally Posted by Hassan Basri
    However in all other windows versions up to XP all these files work perfectly. That is why I am surprised.
    Yea, that's why I asked for the code that is used to play the file. Maybe something is happening without an error and it's not getting to the PlaySound statement.

    Also, it could be a codec issue with MP3 files on Vista. I have no idea since I've never used it.

    Nothing looks wrong with the PlaySound statement. But there might be something happening before you call it.

    One thing to try, convert it to a WAV file then try again. If you want you can e-mail me the file and I can convert it to WAV for you since I have all the software for it.

    [email protected]

  7. #7
    Junior Member
    Join Date
    Feb 2006
    Posts
    20

    Re: Wave Files and Vista. Some working and some not working. Strange.

    Can it be due to plugin or codec problem?
    Never tried vista yet too.

  8. #8

    Thread Starter
    Hyperactive Member Hassan Basri's Avatar
    Join Date
    Sep 2006
    Posts
    324

    Re: Wave Files and Vista. Some working and some not working. Strange.

    Thanks DigiRev, however I don't think it is the codecs as my friend can play the audio files outside of the application, it is only when calling the embedded audio files that the problem occurs. However you may be right about the files not being PCM are the ones that cannot play on Vista. I am awaiting a response from my friend and I will let you know.

    It is strange that in all other windows these files worked perfectly then on Vista I must convert the Mpeg Layer-3 to PCM. It is unfourtanete as PCM files take up much more space.

  9. #9
    Member
    Join Date
    Oct 2006
    Posts
    46

    Re: Wave Files and Vista. Some working and some not working. Strange.

    For WAV files Microsoft introduced the audio compression manager (ACM).
    The ACM manages various audio codecs for using them in a WAV container.
    This means you need an MP3 ACM codec, for example Lame ACM (free).

  10. #10

    Thread Starter
    Hyperactive Member Hassan Basri's Avatar
    Join Date
    Sep 2006
    Posts
    324

    Re: Wave Files and Vista. Some working and some not working. Strange.

    So what you are saying if I add the ACM codec for mpeg-layer 3 to the setup package then the files should work? However my friend can play the file directly in media player, that would mean the codec is installed, no?
    Last edited by Hassan Basri; Feb 25th, 2007 at 10:50 AM.

  11. #11
    Member
    Join Date
    Oct 2006
    Posts
    46

    Re: Wave Files and Vista. Some working and some not working. Strange.

    If you're allowed to do so, yes.

  12. #12

    Thread Starter
    Hyperactive Member Hassan Basri's Avatar
    Join Date
    Sep 2006
    Posts
    324

    Re: Wave Files and Vista. Some working and some not working. Strange.

    Quote Originally Posted by Arne Elster
    If you're allowed to do so, yes.
    Thanks Arne Elster, however my friend can play the file directly in media player on Windows Vista, that would mean the codec is installed, no?

  13. #13
    Member
    Join Date
    Oct 2006
    Posts
    46

    Re: Wave Files and Vista. Some working and some not working. Strange.

    Windows Media Player uses DirectShow, which has its own codecs.
    ACM and DirectShow have nothing to do with each other,
    except that DirectShow can use ACM codecs for reading WAV files.

  14. #14

    Thread Starter
    Hyperactive Member Hassan Basri's Avatar
    Join Date
    Sep 2006
    Posts
    324

    Re: Wave Files and Vista. Some working and some not working. Strange.

    I just checked on my machine I have installed:

    ACM Fraunhofer IIS MPEG Layer-3 Codec (advanced) 0055 L3CODECA.ACM 1.9.0.305

    I checked ou ACM Lame and found it on the internet.

    Which one would be better to include in my setup package?

    Also how would I include these files in my setup? Do I just put the acm file into the system32 folder?

  15. #15
    Member
    Join Date
    Oct 2006
    Posts
    46

    Re: Wave Files and Vista. Some working and some not working. Strange.

    It depends on which you are allowed to redistribute. I doubt you can ship the
    Frauenhofer codec with your software. Maybe you can use Lame, but you should try to find more information about it.

    For the setup, an ACM codec comes with an INF file.
    On rightclick, you'll see the option "install" in the contextmenu.
    But I don't know how this actually works.

  16. #16
    "Digital Revolution"
    Join Date
    Mar 2005
    Posts
    4,471

    Re: Wave Files and Vista. Some working and some not working. Strange.

    I would just keep all files as standard PCM WAV files.

    He can probably play the files outside of your application because Windows Media Player and some other players use DirectShow codecs which are not accessed by the PlaySound API function.

    Or find another method to play the MP3 files. There is a lot of code for that on the net and on these forums.

  17. #17

    Thread Starter
    Hyperactive Member Hassan Basri's Avatar
    Join Date
    Sep 2006
    Posts
    324

    Re: Wave Files and Vista. Some working and some not working. Strange.

    Thanks Arne Elster and DigiRev for your inputs.

    I will look into distributing the codecs, I think there are some free codecs that only decode available.

    As for converting all the files to PCM wave DigiRev it would make the program too huge. That is why I would prefer to get it working as is.

    I just found out that my Vista friend has the Fraunhofer codec on his machine. And he is able to play some of the MPEG Layer-3 files correctly from the application and others don't play. I then compared the files and the difference that I found is

    Working
    Channels = 2 (Stereo)

    Not Working
    Channels = 1 (Mono)

    So it may be a question of channels. I will try to convert the files to Stereo and ask my friend to test it. I will let you know the results.

  18. #18

    Thread Starter
    Hyperactive Member Hassan Basri's Avatar
    Join Date
    Sep 2006
    Posts
    324

    Re: Wave Files and Vista. Some working and some not working. Strange.

    Ok I have confirmation the reason was the channels and not the missing codec. If I convert all my Mono mpeg layer-3 wave files to Stereo mpeg layer-3 wave files it works on Windows Vista using PlaySound.

    Working on Vista using PlaySound
    Channels = 2 (Stereo)

    Not Working on Vista using PlaySound
    Channels = 1 (Mono)

    Thanks for your help DigiRev and Arne Elster.

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