I assume that your using Xcode, as you talk about using Windows in your project.
If that is the case, then you could do it all with Cocoa Frameworks.
First drag your audio file into the project, making sure that it is one of the Core Audio supported audio formats.
Then add the AVFoundation Framework to your project.
Then use something like the example code below, assuming your audio file is called "AudioTrack.mp3"
Code:
property audioPlayer : missing value
on applicationDidBecomeActive:aNotification
set myAppBundle to current application's NSBundle's mainBundle()
set myAudioFileURL to myAppBundle's URLForResource:("AudioTrack") withExtension:("mp3")
set my audioPlayer to current application's AVAudioPlayer's alloc()'s initWithContentsOfURL:myAudioFileURL |error|:(missing value)
end applicationDidBecomeActive:
on playAudio:sender
if not (my audioPlayer's isPlaying()) then
my audioPlayer's play()
end if
end playAudio:
on pauseAudio:sender
if (my audioPlayer's isPlaying()) then
my audioPlayer's pause()
end if
end pauseAudio:
on stopAudio:sender
if (my audioPlayer's isPlaying()) then
my audioPlayer's |stop|()
end if
end stopAudio:
In the above example, I've used the AVAudioPlayer Class of the AVFoundation Framework, because you can control all aspects of the audio playback.
Then I connected three buttons on a window to the playAudio: pauseAudio: and stopAudio: methods which I think you would understand.
I've kept my code very simple with no error checking, just so you can see how the AVAudioPlayer works in basic.
Although I would recommend reading the Apple Developer Doc's on this class for a full picture of it's capabilities.
I've also not posted any of the other required Application Delegate methods to keep it a shorter post.
Regards Mark