General discussion

Locked

Singing from "C"

By ravikishore_g ·
I would like to know how to play a wave or any sound file using C programming. I would be grateful to the one who answers this. It would be of great help if you give me some source code and if suggest any material.

This conversation is currently closed to new comments.

5 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

Singing from "C"

by Rahim In reply to Singing from "C"

for SDK it's BOOL PlaySound(LPCSTR pszSound, HMODULE hmod, DWORD fdwSound);

pszSound is a string to the .wav
hmod should be set to null
fdwSound can be different flags one example would be SND_FILENAME that would tell Windows that pszSound is apath to the .wav

Hope that helps, for full documentation on the flags check out msdn.microsoft.com under Platform SDK.

Collapse -

Singing from "C"

by ravikishore_g In reply to Singing from "C"

The question was auto-closed by TechRepublic

Collapse -

Singing from "C"

by dachev In reply to Singing from "C"

You say 'C programming' and that means the good old C language, where even a single class does not exist.

If you want playing .wav under windows, there are many ways to do that, regardless your language - trough DirectX's DSOUND.DLL (wriley good described in the MicroSoft's SDK), trough accessing the sound driver (which has standart interface, again good described in the MicroSoft's SDKs (WIN32, WINAPI)), and some languages provide their own ways. I am sure that all of this is avaible for you for read.

But if you want to do it under DOS, it gets much more complicated. Starting with your sound card, trough your assembler skills up to your time and motivation to write a sound driver. Anyway, if your case is this urgent, I have much information on that task, so e-mail me a message on 'dachev@mad.scientist.com' (please use this address as my primary is currently down for a while) and I will send you some specifications, and code. I am sorry, but I do not have any complete code.

Collapse -

Singing from "C"

by ravikishore_g In reply to Singing from "C"

The question was auto-closed by TechRepublic

Collapse -

Singing from "C"

by ravikishore_g In reply to Singing from "C"

This question was auto closed due to inactivity

Back to Web Development Forum
5 total posts (Page 1 of 1)  

Related Discussions

Related Forums