Kenny Wyland
Kenny Wyland

Reputation: 21880

Disable Sound on NSButton

In my xib I have defined that some of my NSButtons have a sound file that should play whenever the button is clicked. I'd like to offer my users the option to disable sound effects. Is there any way to disable the sound file that is played by the NSButtons other than just iterating over every button in my view and [button setSound:nil]?

Upvotes: 1

Views: 390

Answers (1)

Parag Bafna
Parag Bafna

Reputation: 22930

You can use NSSound instance method

- (void)setVolume:(float)volume  

The volume range is between 0.0 and 1.0. This method does not affect the systemwide volume.

Upvotes: 1

Related Questions