473,322 Members | 1,421 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Sound in C++

Airslash
221 100+
Hello,

I know this will probably be something extremely difficult, but can anyone provide me with resources or links to resources that allow me to play sounds in C++ by using installed codecs on a given OS?

I'd like to try avoid the use of external libs and maybe even write it myself in a very simple form. It's not to create a highend soundsystem, but just for a proof of concept.

So I really hope someone can put me in the right direction as how to write in C++ code to play a soundfile without importing libs etc.
May 23 '08 #1
5 1635
arnaudk
424 256MB
Do you want to use the soundcard drivers to synthesize sounds, the MIDI interface, or "PC speaker"? Because these are all very different.
May 23 '08 #2
Airslash
221 100+
ideally I'd like to load a wave file and have it played on the host computer.
May 23 '08 #3
Sick0Fant
121 100+
ideally I'd like to load a wave file and have it played on the host computer.
Reinventing the wheel, eh? You're in for more than you bargained for. This technology is not easy to write by yourself. Considering the lack of theoretical importance, why do you want to do this?
May 23 '08 #4
oler1s
671 Expert 512MB
You'll want to be able to do two things. Read the WAV file properly, and use DirectSound.

The WAV file specification is very open and well known. A bit of Googling will get you the standard as well as people's explanations for it.

I'm assuming you're on Windows when I say DirectSound. Obviously, each OS has its own native sound mechanisms. Actually, there's no guarantee of that even.
May 23 '08 #5
Airslash
221 100+
Why I want to do this?
I'm currently in my last year as student programming. And i'm writing a platform that allows the creation of multimedia applications, be it games, be it soundplayers or video players.

So far i've used a dozen libraries all claiming that they're crossplatform, independant of this, independant of that.

The truth however, is that each library used depends on several other libraries, that are either impossible to compile on a windows development environment, or are totally abandoned, or simply without decent manuals / explanations on how to use them.

Hence the reason I want to write my platform in such a way that i'm not dependent on libraries, but that everything needed is in.


and because it simply interests me :)
May 24 '08 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Larry L | last post by:
I want to play a repetitive sound, and have a user click on a button each time it plays (say 5-10 times) and measure how far off he is from the sound each time. The only way I know to play a...
1
by: Marco Krechting | last post by:
Hi All, I have a database with the timer function set to warn the user that arecord is due to expire. Is there a Win API that I can use so a loud warning will go off. Not this simpel beep in...
4
by: Robert Gravereaux | last post by:
I'm putting together a C# .Net forms project on win2k. The application requires some sort of horn sound. I've never implemented any audio in .Net, so I'm not sure how best to accomplish this. ...
1
by: Lam | last post by:
how can I play sound file in a .aspx page written in C#? I try to use the code like the following. But whenI call the play function play("sound.wav", this.SND_ASYNC) my computer give out "be"...
4
by: Larry Serflaten | last post by:
I'm adding a bit of sound to a simple game I've got going, and I want to have several sounds on at the same time, so I go looking to use the MCISendString commands and find they CRASH MY COMPUTER...
16
by: Dobedani | last post by:
Dear All, I found the code added below at: http://simplythebest.net/sounds/sound_guide.html Unfortunately, the code doesn't seem to work in Firefox. These are the error messages I can see in...
6
by: laredotornado | last post by:
Hi, Is there a cross-browser way to play short (< 25K) sound files without spawning new windows or embedding any visual controls on the page? I would like to click a button and hear my short...
6
by: =?Utf-8?B?VmVybm9uIFBlcHBlcnM=?= | last post by:
I have an application that is designed for using with a bar code scanner. I want the user to know that the scan was complete and the data was entered, so I am playing a system sound after data...
4
by: kid joe | last post by:
Hello I've got interested in learning some basic sound programming bits in C... mainly I want to know how to go about accessing the sound devices - reading from them mainly - in windows and...
8
by: chromis | last post by:
Hi, I've been struggling to get sounds to work with attachSound when the sounds are stored in a swf loaded into another swf. I came across a post on a forum which supposedly explains how to to do...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.