Все вопросы: [avaudioplayer]
39 вопросов
Почему Xcode показывает предупреждение при использовании протокола делегата AVAudioPlayer в файле appdelegate.h?
//---------MyAppDelegate.h @interface MyAppDelegate : NSObject <UIApplicationDelegate, AVAudioPlayerDelegate> { // --- в каком-то другом файле .m пытаемся получить доступ к токену устройства, находящемуся в MyAppDelegate ---------- MyAppDelegate *appDelegate = [[UIApplication sha...
Программно проверяете наушники, подключенные к устройству?
Я использую класс AVAudioPlayer для воспроизведения файлов .mp3 в своем приложении.Можно ли программно проверить, подключены ли наушники к устройству? В устройствах iPod первого поколения полоса регулировки громкости скрыта (для музыки и видео), когда наушники не подключены.
почему AVAudioplayer не останавливается / останавливается, когда viewWillDisappear?
Я использую в своем приложении avaudioplayer.при просмотре исчезнет, я хочу приостановить / остановить звук, и на экране появится значок «Я хочу воспроизвести звук снова». как мне это сделать?я использую этот код на viewWillAppear: - if(self.TickPlayer) { [self.TickPlayer play]; } if(se...
iPhone - запустить несколько экземпляров AVAudioPlayer одновременно
Я использую несколько экземпляров AVAudioPlayer для одновременного воспроизведения нескольких аудиофайлов.Я запускаю цикл, чтобы начать воспроизведение аудиофайлов (заранее вызывается prepareToPlay, а цикл вызывает только метод воспроизведения) Но всегда один из игроков не играет синхронно.Ка...
Как определить длину аудиофайла, связанного с AVAudioPlayer
Кто-нибудь знает, как получить атрибуты из файла, связанного с экземпляром AVAudioPlayer ... в частности, я ищу, как определить длину файла WAV.
iPhone AVAudioPlayer останавливает фоновую музыку
Я только что заметил, что на моем iPod Touch, когда мое приложение запускает короткий файл wav для воспроизведения с помощью AVAudioPlayer, музыка приостанавливается.Это нормально? Я не могу найти упоминания об этом, и похоже, что это было бы где-то отмечено.Есть ли способ сохранить музыку, по...
Можно ли смешивать AudioServicesPlaySystemSound и AVAudioPlayer?
У нас есть игра, которая очень близка к выпуску, но у нас есть одна очень неприятная проблема. Один из телефонов наших бета-тестеров, он не слышит звуковые эффекты в игре. Однако он прекрасно слышит фоновую музыку и музыку на титульном экране. Фоновая и титровальная музыка воспроизводятся чер...
AVAudioPlayer с внешним URL-адресом на * .m4p
Моя проблема заключается в следующем. Я получил этот код и предполагаю, что NSURL поврежден, так как AVAudioPlayer после инициализации равен нулю: NSString *dummyURLString = @"http://a825.phobos.apple.com/us/r2000/005/Music/d8/a8/d2/mzi.jelhjoev.aac.p.m4p"; NSError *error; NSURL *url = [NSURL...
iPhone SDK: AVAudioPlayer шумит при паузе или завершении работы
Я воспроизводю несколько файлов wav (я пробовал использовать caf, но случилось то же самое) с помощью AVAudioPlayer. Все файлы меньше 2 секунд, а звук 16 бит - размер файла ~ 40кб. Я обнаружил, что он издает небольшой шум (это сложно описать, но тихий звук, похожий на "даб") в двух случаях: ...
AVAudioPlayer Output to Speaker
After searching around for how to send AVAudioPlayer output to the iPhone's speaker, I found this: iPhone audio playback: force through internal speaker? Despite setting the category correctly to AVAudioSessionCategoryPlayAndRecord, this solution doesn't seem to be working for me and won't even...
AvAudioPlayer setting delegate to nil releases the delegate object?
@implementation MyClass -(id) init { NSString *path0 = [ [NSBundle mainBundle] pathForResource:@"myfile" ofType:@"m4a" ]; mSound = [[AVAudioPlayer alloc]initWithContentsOfURL:[NSURL fileURLWithPath:path0] error:NULL]; mSound.delegate = self; } -(void) release { mSound.deleg...
iPhone - AVAudioPlayer - convert decibel level into percent
I like to update an existing iPhone application which is using AudioQueue for playing audio files. The levels (peakPowerForChannel, averagePowerForChannel) were linear form 0.0f to 1.0f. Now I like to use the simpler class AVAudioPlayer which works fine, the only issue is that the levels which ...
AVAudioPlayer initialization error
I initialize my AVAudioPlayer instance like: [self.audioPlayer initWithContentsOfURL:url error:&err]; url contains the path of an .m4a file The following error is displayed in the console when this line is called :"Error Domain=NSOSStatusErrorDomain Code=1685348671 "Operation could not be...
AVAudioPlayer can play while iPhone screen is locked; can it record at that time too?
You can easily play sounds and record sounds using the high level AVAudioPlayer. And you can play sounds using the same framework, while the iPhone screen is locked. Can you record sounds at that time?
iPhone programming: avaudioplayer leaks memory on play
I'm new to using avadioplayer and I seems to have a memory when ever I play a sound. I cannot figure out what I am missing to get rid of it inside Instrument. could this be a false positive? ViewController.h : @interface ISpectatorViewController : UIViewController <UIAccelerometerDelegate>...
playing a .caf file: works fine in simulator but not in iPhone
I'm building a voice recorder. Recoding and playing works fine on simulator. But on iphone it doesn't work. (I followed the exact steps as mentioned in iPhoneOSProgrammingGuide/AudioandVideoTechnologies) printf("%s(player)\n",[[self.soundFileURL absoluteString] UTF8String]); AVAudioPlay...
AVAudioPlayer memory leak
I'm stuck on some weird memory leak problem related to the AVAudioPlayer and I need help after trying everything that came to mind. Here is the short description of the problem - code appears right after. I initialize my player and start to play the sound track in an endless loop (and endless lo...
AVAudioPlayer is not rentrant correct?
It appears that AVAudioPlayer is not reentent. So in the following would soundfx play to completion, delay 1 second, then play again, rather then the 1 second delay - and resultant overlapping playback I desire: // ... AVAudioPlayer* soundfx = [[AVAudioPlayer alloc] initWithContentsOfURL:sound...
Pre-built audio player UI on iphone?
My boss seems to think there's a way to play audio files via a built-in QT interface that comes up with a modal UI, much like address book framework does. Also, the mail app pops up a QT modal player to play attached audio files and then hides itself when done. I've done a good 2 hours of resea...
Problem playing audio after pausing with AVAudioPlayer
I have an issue with my AVAudioPlayer in which if it is paused, I cannot get it to play again. Calling [audioPlayer play] after it is paused returns NO rather than the usual YES. Any idea what could have caused this? Someone else has this same issue as well: http://www.iphonedevforums.com/foru...
I put a button on a table view cell that play sound when they are pressed but
I put a button on a table view cell that play sound when they are pressed, when I press the button it stop the sound. But pressing another button on another cell it doesn't plays another sound while the other still playing. I hope that when another button is pressed in another table cell it will ...
How to use AVAudioPlayer to play MP4?
I want to use AVAudioPlayer to play MP4 files from iTunes generator. I could use UIWebView to play it and it worked, but I want to put an image of my choice on the background of the player instead of the "QuickTime"-logo. Here is an example of the m4p file I want to play with AVAudioPlayer.
AVAudioPlayer fade volume out
I have an AVAudioPlayer playing some audio (duh!) The audio is initiated when the user presses a button. When they release it I want the audio to fade out. I am using Interface builder...so I am trying to hook up a function on "touch up inside" that fades the audio out over 1 sec then stops. A...
AVAudioPlayer not responding
I initialize an AVAudioPlayer instance: NSString* path = [[NSBundle mainBundle] pathForResource:@"foo" ofType:@"wav"]; AVAudioPlayer* player =[[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath:path] error:nil]; //Returned object not nil, indicating that the file has loaded succ...
AVAudioPlayer to play short sounds on my iPhone?
I want to use AVAudioPlayer to play short sounds... because I have more control than System Sound. I have several buttons which are hooked up to play several different short sounds. Each sound file is about 1.5 - 2.0 seconds. Everything works fine ...except ...I have to wait for the sound to st...
iPhone Music App: Playing from a Cache of Notes
I am working on an app that will play back notes from a 12-tone diatonic scale that spans several octaves. This will basically be a makeshift wavetable synthesizer. Times that with the number of instruments to use. The notes are stored as .wav files and will be cached into RAM to prevent ove...
AVAudioPlayer resetting currently playing sound and playing it from beginning
I'm having an issue using AVAudioPlayer where I want to reset a player if it's currently playing and have it play again. I try the following with no luck: The sound plays once but then the second time i select the button it stops the sound, the third time starts the sound up again. //Stop the ...
Using Finch to play sounds on iphone
I have an application which has two kinds of sounds: 1. Background sounds, looping forever till next view. 2. Sounds clips that could be played separately or all in one go. Previously i tried using AVAudioPlayer but there was always a very little silence interval between two clips (to which i di...
Сделать действие, когда звук закончился в AVAudioPlayer?
Я использую среду AVAudioPlayer, и у меня есть несколько звуков, которые воспроизводятся по одному. Когда звук закончится, я хочу, чтобы приложение что-то сделало. Я попытался использовать audioPlayerDidFinishPlaying для выполнения действия в конце первого звука, но я не смог использовать это дл...
Waveform API от Apple коммерческое?
В новом рекламном ролике iPhone 3GS Apple демонстрирует голосовое управление с красивой синей анимацией волны. Доступен ли этот визуальный эффект для рендеринга волновых форм (или, может быть, просто объемов) в виде вызова API или исходного кода? (Не голосовое управление, а только аудиовизуализа...