I need to generate some software-created tones. Sound won’t work because i need to change pitch at run-time. NotePlayer won’t work because I can’t be constrained by conventional note steps or half steps. I need to specify one tone, at, lets say, 1000Hz and a second at, for example, 1001Hz, to demonstrate a particular physical phenomenon. The tones do not need (and should not have) any “color”; sine waves (with no particular attack or decay) are really what is needed. MacOS is top priority with Windows being “nice to have”.
How can I do this?
Many thanks
Jim Wagner
Oregon Research Electronics
Oops, it hangs when I start it (in current Xojo), it crashes at
// start playing sound through the device
err = AudioDeviceStart(device.ptr(0), (AddressOf wavePlayerCallback) )
DebugErr “AudioDeviceStart err=”+format(err,"#")
I do have multiple versions of RB to back before 5.5 so I will try some older versions to see whether success is possible. This is an area that I know absolutely nothing.
In the end I only needed a fixed number of tones and ran into issues with Xojo’s implementation of volume control in Windows (only in WIndows mind you) is broke (let’s say incomplete - it has been like that since like forever - see post). So I opted to create the specific files I needed, package them, and play with the right delays, and combinations (i.e. I did not go the route of “on-the-fly” tone generation).
But like I said above, using the links above I was able to create “on-the-fly” tones. I can’t share the final application for SELCAL, but I have a small test application for generating WAV tones if you’re interested.
Creating a PCM/Wave file and then playing it is fairly easy.
But because of the ‘change pitch at run-time’ -requirement, that’s not what you want right?
Thats my sense. HOWEVER, as I now think about it, maybe I could use several wav files - one higher pitched, one lower pitched, one as a combination. Then, just play the appropriate one. In the end, that may be easier.
Langue - how could I get a copy of your WAV generator?