TonicAudio / Tonic

Easy and efficient audio synthesis in C++
The Unlicense
522 stars 63 forks source link

Problem using library (output device parameter value is invalid) #265

Open LordWaffle opened 9 years ago

LordWaffle commented 9 years ago

Hello,

I'm wondering if you could help me out here. So when I open up the standalone example within VS2013, everything works fine. However, when I import the library to a c++ project I want to use it with, I receive the error:

RtApi::openStream: output device parameter value is invalid.

I find this somewhat strange, and am not sure where to start. I ensured that the rtParams.deviceId was the same as in the provided example. Everything seems to be included the same, but I cannot get the output to open... Any suggestions would be greatly appreciated. Maybe it has something to do with the project properties, but I am fairly certain I got everything included that should be, as I'm not getting any errors. I'm not sure if it's relevant to the issue, but I also seem to get output of:

"RtApiDummy: This class provides no functionality."

when declaring:

RtAudio dac;

Thank you for your time.

Cheers, Jesse

aramazhari commented 7 years ago

Hello, I know this is an old thread but I ran into the same exact issue. It turns out the getDeviceCount() is returning 0 because the code was not calling the right getDeviceCount(), but a dummy template of it.

Since you created your own project, I think you may have forgotten to do these two things: Right click on your project and go to properties:

  1. You need WIN32 and __WINDOWS_DS__ in C/C++ -> Preprocessor -> Preprocessor Definitions.
  2. Include dsound.lib in the Linker -> Inputs -> Additional Dependencies .

I hope this helps.

diegodelaFuenteCuraqueo commented 1 year ago

I know this is old but I would like to explain how I fixed this: After several attempts compiling my code, and getting the same error on console ("RtApiDummy: This class provides no functionality"), I deleted the RtAudio.o file in order to force the compiler to build the .o file again. After that, my code was able to detect the right audio device, and the RtApiDummy message disappeared.