Mac OS 9 Discussion > Development & Programming

Playing sound at an advanced level.

(1/2) > >>

IoIxD:
(Note: this was meant for the programming forum, I accidentally put it in the Software forum by accident)

So I recently managed to compile the FFmpeg libraries for Mac OS 9 and get a video player set up. It doesn't do audio though, and it's like this after I spent literal days losing sleep trying to get the decoded sound from ffmpeg playing. I've tried, in this order:


* Researching how to do it with Mac-specific functions (I can't find anything other then information on loading in supported sound files from resource files and etc. which isn't an option. I need a library that can play decoded sound from ffmpeg)
* SDL1.2 (completely broken on Mac OS 9)
* OpenAL (needlessly complex and confusing when all I need is something that takes a callback function and plays decoded waveforms)
* PortAudio (has a known issue(?) where the docs say you cannot do any malloc/complex memory stuff in the callback function, which is exactly what ffmpeg does when decoding audio. This sounds like a strange problem, but I have confirmed that, yes, my program does become unstable when I try to do it, and on Mac OS 9 it outright hangs the system).
Basically, anything I've found is either too new, too complex, or too poorly documented.

So I either need to find out how to directly play waveforms to Classic Mac OS, or I need to find a sound
library circa 2000 that supports Classic Mac OS.
Is there anybody who can help me here?

IoIxD:
I meant this for the programming forum. Oops.

joevt:
Did you read the sound and audio related stuff at https://developer.apple.com/library/archive/navigation/#section=Platforms&topic=macOS
Search for sound
Search for audio
Sort by date to make sure you're looking at Mac OS 9 related stuff instead of Mac OS X.

Mat:
Not exactly what you asked for, but John Dalgliesh  solved the h.263 decoding using ffmpeg as a QickTime component. You can see his sources : https://defyne.org/i263/
Perhaps this helps with your project?

Also you may have a look into the old Audacity sources how they handled the sound?

Naiw:
You will likely not find any library that does what you want.

You have two options, one is to use quicktime and write a component as already been said, the other is to use the Sound Manager (SndPlayDoubleBuffer)... the latter requires you to be extremely careful about what you do as the callback runs at interrupt time which makes it unsafe for most toolbox APIs, the latter is what most audio players used (there are a few exceptions that used quicktime under the hood) but there is a big downside to quicktime- which may not be an issue for your particiular application but it is for say a mp3 player or such... the downside is that quicktime runs during regular "cooperative multitasking", thus if you hold down a menu playback will stop.

Navigation

[0] Message Index

[#] Next page

Go to full version