I am using Xcode to create a Mac OSX, Objective-C, cocoa app. I have sound effects in my app that have a very high volume (it hurts my hears!) And some sound effects are so low that I can’t hear them…
This is what my code looks like:
- (void)playSound {
NSSound *sound = [NSSound soundNamed:@"Start-up-sound-1"];
//This is where I want to turn the volume up
[sound play];
NSSound *sound2 = [NSSound soundNamed:@"Start-up-sound-2"];
//This is where I want to turn the volume down
[sound2 play];
}
How can I change the volume on my mac without pressing the volume keys on my keyboard?
Please help and thanks guys 😀
You can do a couple of things ,
Either you can just take an app like Audacity and change the volume of the samples (better), or you can use some other library like CocosDenshion that has volume controls.
As far as i’m aware, NSSound doesn’t have a volume control, and I do think the easiest solution would just be to edit your actual samples.
Shai.