Skip to content
This repository has been archived by the owner on Jul 17, 2024. It is now read-only.

Audio Wont Play #13

Closed
zwebert31 opened this issue Jan 28, 2011 · 12 comments
Closed

Audio Wont Play #13

zwebert31 opened this issue Jan 28, 2011 · 12 comments

Comments

@zwebert31
Copy link

I am probably doing something rather stupid but i just cannot figure it out. I am new to this. Any help would be appreciated.
- (void)viewDidLoad{
[super viewDidLoad];
engine = [[Finch alloc] init];
snare = [[Sound alloc] initWithFile:
[[NSBundle mainBundle] URLForResource:@"snare" withExtension:@"wav"]];
}

- (void)accelerometer:(UIAccelerometer *)accelerometer didAccelerate:(UIAcceleration *)acceleration {
    if (acceleration.z < -0.7)
        [snare play];
}
@zwebert31
Copy link
Author

i have tried the same thing with the revolver sound class also, it has not worked

@zoul
Copy link
Owner

zoul commented Jan 28, 2011

Looks fine. Are you sure it’s not the accelerator code? Do the events fire? Did you try playing the sound in response to touch, for example?

@zwebert31
Copy link
Author

the event is firing i checked by updating a label under those conditions. I havnt tried it with a touch event but maybe I should try that next. could it be the sound in my simulator is not working?

@zoul
Copy link
Owner

zoul commented Jan 28, 2011

Ah yes, definitely try on the device.

@zwebert31
Copy link
Author

I havnt sprung for the dev license yet. I am testing the accelerometer over wifi. I might have to buy it now though I suppose.

@zoul
Copy link
Owner

zoul commented Jan 28, 2011

Did you try the demo project? Does it work in your Simulator?

@zwebert31
Copy link
Author

In fact it does work. So the simulator probaly isnt the problem

@zoul
Copy link
Owner

zoul commented Jan 28, 2011

Can you mail me your project?

@zwebert31
Copy link
Author

Yes. I feel dumb for asking but what would be the best way of going about that?

@zwebert31
Copy link
Author

ok i just sent it

@zoul
Copy link
Owner

zoul commented Jan 28, 2011

Take a look in the console (Cmd-Shift-R), Finch complains of sound initialization error. In your case the problem is in the sound file – Finch only supports 8bit and 16bit sample resolutions, whereas your sound has a 24bit sample resolution.

@zwebert31
Copy link
Author

thank you sir. i really appreciate all the effort! it works now!

This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants