Questions tagged [avaudiofile]

65 questions
2
votes
3 answers

Convert audio into raw PCM data of type [Double]

I'm trying to convert a recorded audio file into raw PCM data of type [Double]. I found a way to load and convert audio to PCM data of the type [Float32] like this: // load audio from path let file = try! AVAudioFile(forReading:…
user967493
  • 143
  • 2
  • 8
2
votes
2 answers

How to save AVAudioFile to document directory?

I want to save AVAudioFile to document directory with NSDictionary. Can anyone help me? AVAudioFile *audiofile=[[AVAudioFile alloc] initForWriting:destinationURL settings:settings error:&error]; save this audio file to document directory...
2
votes
1 answer

AVAudioFile in Swift Playground results in "error -54"

I decided to have a play with AVAudioPlayer in a Swift Playground. The following code works fine in a normal Swift project, but returns the following error when running it in a Playground (in the assistant editor): 2015-05-12 00:08:04.374…
greekgoddj
  • 117
  • 1
  • 6
1
vote
1 answer

How to use AVFAudio's SDK to Record, Play and save audio

Ive been trying to implement the AVFoundation's framework AVFAudio in order to record audio, play audio, as well as change the audio data per the user's selected presets. Ive also been trying to find out how to save files locally to the user's…
1
vote
1 answer

Setting AVAudioFile `framePosition` causes crash

Whenever I set the framePosition of an AVAudioFile to something other than the current framePosition I get a crash: error - 6658 which I looked up in the Apple Docs and is: kExtAudioFileError_InvalidSeek: An attempt to write, or an offset, is…
aritroper
  • 1,671
  • 5
  • 16
  • 26
1
vote
1 answer

How can I store and retrieve audio files to and from CloudKit?

I am attempting to record voice messages and store them as CKAssets on CloudKit. I convert them into an AVAudioFile and save them to CloudKit as one of several properties on a Post record. var recordedMessage: AVAudioFile? var recordedMessageURL:…
Anthroman
  • 53
  • 7
1
vote
3 answers

How can I use audio file as audio source in SpeechRecognition in Python?

I used speech_recognition.AudioFile in Python 3.6 , but this error was indicated: AttributeError: module 'speech_recognition' has no attribute 'AudioFile' This is my code: #!/usr/bin/env python3 import speech_recognition as sr # obtain path to…
1
vote
0 answers

Is it possible to use stream urls instead of downloading media to disk when instantiating an AVAudioPlayerNode?

We are using Amazon Cloudfront to stream audio to the iOS application. We need specific functionality that is only available on the AVAudioEngine which is why we are trying to instantiate AVAudioPlayerNode. The problem is that it appears that the…
1
vote
0 answers

Is it possible to merge two different AVAudioPlayer tracks

I have two instances of AVAudioPlayer playing two different tracks with different volume and rate (One is instrumental track and other is recording of song). I want to merge those two tracks to a single one. Is it possible to do it with…
1
vote
2 answers

How do I write AVAudioCompressedBuffer to an AAC file in iOS?

I've successfully converted the AVAudioPCMBuffers from AVAudioEngine into AVAudioCompressedBuffers with an AAC format. Now I'm trying to write those buffers to a file but don't know how to do it. AVAudioFile only accepts AVAudioPCMBuffers. Any help…
dyah
  • 63
  • 8
1
vote
1 answer

Reversing an audio file

I'm using AVAssetReader and AVAssetWriter to reverse an audio file. However, the resulting reversed audio is very jerky. What's the best practice for reversing an audio file? Any help is much appreciated. -(void)reverseAudio:(NSURL *)videoURL…
user1752054
  • 372
  • 4
  • 17
1
vote
1 answer

how to change the pitch of recorded audio getting me following error

Terminating app due to uncaught exception 'com.apple.coreaudio.avfaudio', reason: 'required condition is false: node != nil' AVAudioFile *file=[[AVAudioFile alloc] initForReading:_recordedvoice error:nil]; AVAudioFormat…
1
vote
1 answer

Tapping microphone on AVAudioEngine input not working

I am setting up an AVAudioEngine implementation to take audio from the microphone and stream it to a websocket connection. First things first, I have tapped the microphone input and an intermediate mixer that downsamples the microphone's audio from…
Josh
  • 6,251
  • 2
  • 46
  • 73
1
vote
1 answer

session:didReceiveFile: Not Playing Audio File (iPhone to Watch)

I am having an issue with getting an audio file that I record on my iPhone to play out of my Watch speakers. Here is the code I have for sending from iPhone to Watch. - (void)sendLiveAudioRecordingToWatch { NSError *error; NSFileManager…
S. Stark
  • 189
  • 1
  • 1
  • 11
0
votes
1 answer

How can I convert an aac encoded octet-stream into a wav in swift

I'm attempting to convert a playable aac encoded octet-stream (recording.aac) that I recorded from an aac encoded livestream (https://archives.kdvs.org/stream) into a wav file. I'm not sure where to start and don't see much information online as how…