CD Player using waveOutXXX APIs?

This is a discussion on CD Player using waveOutXXX APIs? within the C++ Programming forums, part of the General Programming Boards category; Hi all! I want to make a CD player, which will use the waveOutXXX APIs to play the CD. What ...

  1. #1
    Registered User
    Join Date
    Oct 2001
    Posts
    104

    CD Player using waveOutXXX APIs?

    Hi all!

    I want to make a CD player, which will use the waveOutXXX APIs to play the CD.
    What I actually need is to read data from the CD, put it into buffer, then manipulate it, and after that send it to the sound card to play it. So, this should do some special effects on music CD in real time.

    But I see no way how to use waveOutXXX APIs to deal with CD.
    Any idea?

    Thanks!
    Ilia Yordanov,
    http://www.cpp-home.com ; C++ Resources

  2. #2
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,590
    Are you sure the Windows MMIO does not have some CD functions?

  3. #3
    Hardware Engineer
    Join Date
    Sep 2001
    Posts
    1,398

    Exclamation You need a 'RIPPER"

    Hmmm...

    You need to make a "CD ripper" to read the CD. Sorry, I don't know how to do this, but maybe that info will help your research. I have the impression that this is tricky, because some of the early rippers I tried were unreliable.

    Just in case you don't already know:
    - The files on a music CD are not in the .wav format. You can't drag-and-drop files from a music CD to a hard drive. (Although, I haven't tried it with WinXP.)

    - When you play a CD (in the normal way), the the audio data does not pass through the IDE cable, data bus CPU, etc. The CD drive has a built-in Digital-To-Analog converter (DAC), and the analog audio is sent to the sound card via an analog cable.

    - When you play a wave file from the hard disk, the audio data does pass through the data bus, etc, and the sound card's DAC is used.

  4. #4
    Registered User glUser3f's Avatar
    Join Date
    Aug 2003
    Posts
    345
    I guess this is offtopic, but have you looked at FMOD? before learning it, I had no idea how to output sound other than the dreaded PlaySound, it took me an hour or so to read the manual, and I started programming the sound system of a 3D engine I'm working on, it includes audio CD playing, ripping, effects...
    When all else fails, check it out.
    www.fmod.org

  5. #5
    Registered User
    Join Date
    Oct 2001
    Posts
    104
    Hi all!

    Thanks for your replies!
    I actually can do CD player but with MCI which does not let me have any access to the buffers. But buffers is what I need actually.
    So, I am sure it is possible, the question is how?!

    I haven't looked into the MMIO functions yet, but will do it now...

    I am open to any suggestions..

    P.S. This is for commercial product, so I can't use 3rd party controls. Everything I do, I do it by myself
    Ilia Yordanov,
    http://www.cpp-home.com ; C++ Resources

  6. #6
    Registered User
    Join Date
    Oct 2001
    Posts
    104
    mmio won't work.

    I tried that though:

    Code:
    #include <iostream.h>
    #include <fstream.h>
    
    int main()
    {
    	ifstream OpenFile("F:\Track05.cda",ios::binary);
    
    
    	unsigned long int i = 0;
    	short f;
    
    	while(!OpenFile.eof())
    	{
    		OpenFile.read((char *)&f,sizeof(f));
    		i++;
    	}
    	OpenFile.close();
    
    	cout << i << endl;
    
    	return 0;
    }
    But it always couts 23, no matter which track I select. Any idea why?
    Ilia Yordanov,
    http://www.cpp-home.com ; C++ Resources

  7. #7
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,590
    Well then you could fire up DirectX and use DirectSound. All you need is a simple window and its handle to use DirectSound. Also you get the benefit of sound acceleration and access to primary (if u need it) and secondary buffers.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 8
    Last Post: 11-03-2008, 08:48 PM
  2. HUGE fps jump
    By DavidP in forum Game Programming
    Replies: 23
    Last Post: 07-01-2004, 10:36 AM
  3. cd player adapter voltages
    By Leeman_s in forum A Brief History of Cprogramming.com
    Replies: 1
    Last Post: 03-20-2004, 01:14 PM
  4. playing audio cassettes on my cd player
    By Terrance in forum A Brief History of Cprogramming.com
    Replies: 1
    Last Post: 07-09-2003, 09:22 AM
  5. MCI CD Player
    By soutine in forum Windows Programming
    Replies: 0
    Last Post: 11-02-2001, 04:03 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21