Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "Tweak.h"
- @implementation PlayOof
- -(void)playSong {
- //NSString *soundFilePath = [[NSBundle mainBundle] pathForResource:@"/Library/oof/oof" ofType:@"mp3"];
- NSURL *soundFileURL = [NSURL fileURLWithPath:@"/Library/oof/oof.mp3"];
- AVAudioPlayer *player = [[AVAudioPlayer alloc] initWithContentsOfURL:soundFileURL error:nil];
- player.numberOfLoops = 5;
- [player play];
- }
- @end
- %hook SBVolumeControl
- -(void)increaseVolume {
- %orig;
- PlayOof *Oof = [[PlayOof alloc] init];
- [Oof playSong];
- NSLog(@"Did it work? up");
- // The NSLog output works perfectly when the volume keys are pressed but no sound plays
- }
- -(void)decreaseVolume {
- %orig;
- PlayOof *Oof = [[PlayOof alloc] init];
- [Oof playSong];
- NSLog(@"Did it work? down");
- }
- %end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement