AFSoundManager icon indicating copy to clipboard operation
AFSoundManager copied to clipboard

can't play loaction mp3 file

Open JWLAZY opened this issue 10 years ago • 3 comments

i try your demo ,it is ok,but i used cocoapads ,it don't work and The program crash.

JWLAZY avatar Jan 16 '15 14:01 JWLAZY

Hi, could you share more details about your problem? Logs, errors, crash messages, the file URL you're trying to play, etc.

AlvaroFranco avatar Jan 16 '15 17:01 AlvaroFranco

thank you very much! ^_^

[[AFSoundManager sharedManager] startPlayingLocalFileWithName:@"1.mp3" andBlock:^(int percentage, CGFloat elapsedTime, CGFloat timeRemaining, NSError *error, BOOL finished) {
       _lab1.text = [NSString stringWithFormat:@"%d",percentage];
        _lab2.text = [NSString stringWithFormat:@"%f",elapsedTime];
        _lab3.text = [NSString stringWithFormat:@"%f",timeRemaining];
    }];
this is ok, but if i use cocoapad to install afsoundmanager ,and use the new method ,it didn't working
[[AFSoundManager sharedManager] startPlayingLocalFileWithName:@"1.mp3"  atPath:nil withCompletionBlock:(progressBlock)block :^(int percentage, CGFloat elapsedTime, CGFloat timeRemaining, NSError *error, BOOL finished) {
       _lab1.text = [NSString stringWithFormat:@"%d",percentage];
        _lab2.text = [NSString stringWithFormat:@"%f",elapsedTime];
        _lab3.text = [NSString stringWithFormat:@"%f",timeRemaining];
    }];

JWLAZY avatar Jan 17 '15 02:01 JWLAZY

The first code no longer works since that method was changed in previous updates. The second code should work fine. Why it doesn't work? It crashes the app? The sound doesn't play? If it crashes, please post the crash message log.

AlvaroFranco avatar Jan 17 '15 12:01 AlvaroFranco