Questions tagged [avaudiofile]
The avaudiofile tag has no usage guidance.
64
questions
0
votes
1
answer
90
views
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 ...
0
votes
1
answer
49
views
how to save and share the proccessed audio in swift?
I'm trying to modify an iOS app that takes audio via text to speech and applies pitch and rate changes to it, and then allows the user to save and share the processed audio. The recording and ...
0
votes
1
answer
68
views
ValueError:The requested array has an inhomogeneous shape after 2 dimensions.The detected shape was(318, 20)+inhomogeneous part
from sklearn.neural_network import MLPClassifier
#Initialise Multi Layer Perceptron Classifier (MLP)
model = MLPClassifier(alpha = 0.01, batch_size = 256, epsilon = 1e-08, hidden_layer_sizes = (400,), ...
0
votes
0
answers
58
views
using Gstreamer i am loopback the dmic to speaker the sound is good but when i recorded that mic and play that time sound is not good
i am using gst-launch 1.0
i wanted to record raw file using the gstreamer and also wanted to play raw file using gstreamer.
put the command using which i am testing the dmic. if i recorded file in 1x ...
0
votes
0
answers
43
views
How can I parse/read, not play, an audio file in Swift based on its formatting?
My app already finds silence in audio as it is being recorded on an iOS device. I compare background and speaking volumes from samples then compare it and so far it has been pretty accurate. This way ...
0
votes
1
answer
387
views
My writing the installTap buffer to an AVAudioFile seems to fail data-wise
I am trying to save the buffer from my installTap to a file. I do it in chunks of 10 so I'll get a bigger file. When I try to play the written file (from the simulator's directory) QuickTime says that ...
1
vote
1
answer
232
views
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 ...
4
votes
0
answers
1k
views
Write incoming audio raw data to AVAudioPCMBuffer of AVAudioFile and play AVAudioFile
I'm receiving packets of audio raw data within a callback function with the following properties:
640 samples per packet
32 kHz sampling rate
Signed 16-Bit PCM encoding
Single channel
In other words,...
3
votes
2
answers
1k
views
AVAudioFile write not working Swift iOS 14
I have the following function:
private func getPCMBuffer(utterance: AVSpeechUtterance,
completion: @escaping (Result<AVAudioPCMBuffer, Failures>) -> Void
) {
...
0
votes
1
answer
225
views
Get samples of audio clip in AVAudioPlayer?
Is there a property on the AVAudioPlayer class that I can use to get the samples? If not is there another class I can use to get this information?
Here's what I have:
var openDialog = NSOpenPanel....
2
votes
0
answers
521
views
How can I resample an audio file programatically in swift?
I would like to know if it's possible to resample an already written AVAudioFile.
All the references that I found don't work on this particular problem, since:
They propose the resampling while the ...
0
votes
1
answer
523
views
AVAudio and Offline Manual Rendering Mode - can't write buffers of higher frequencies into output file
I'm reading an input file and with the offline manual rendering mode, I want to perform amplitude modulation and to write the result to an output file.
For the sake of testing, I produce pure sine ...
1
vote
1
answer
408
views
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:
...
-1
votes
1
answer
190
views
Combining 2 audio files is Swift
I am trying to combine 2 audio files.
The main problem is that audio files are lossless .flac files.
I tried creating AVMutableComposition, then creating 2 AVURLAsset for each audio and use ...
2
votes
0
answers
189
views
AVAudioFile (Mac/iOS) : encode audio to constant bitrate AAC
I would like to encode audio buffers to M4A/AAC file using AVAudioFile. It works except that the output file is always AAC with a variable bitrate, even when I configure the AVAudioFile with specific ...
2
votes
0
answers
197
views
How to export a sample of a file with AudioKit 5.0.b1?
I am trying to update my app so it can run using Xcode 12.0 beta 3 (12A8169g) and AudioKit 5.0.b1. Previously I had this code to export my AKAudioFile into a desired format and with defined start and ...
0
votes
0
answers
232
views
How to write to an AMR-WB file in multichannel mode with Python under linux from RTP PAYLOAD
I've successfully written the RTP-payload into an amr-file and it works fine, according to the answer written in this question.
https://stackoverflow.com/questions/61961965/convert-rtp-payload-payload-...
2
votes
1
answer
462
views
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 ...
0
votes
1
answer
515
views
Audio from a file generated from an AVAudioEngine bus tap has different speed than the one played on device output
I am generating audio with an AVAudioEngine. I am then installing a tap on the mainMixerNode output of the engine which provides a AVAudioPCMBuffer which is then written into an MPEG4ACC AVAudioFile. ...
0
votes
1
answer
786
views
How to add observer to play and pause actions for audio file in WKWebview?
I want to add notifications for play and pause actions of audio file in wkwebview,
Image shows how audio files are in WKWebview
1
vote
3
answers
4k
views
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
...
2
votes
1
answer
1k
views
Crash on Read AVAudioFile Buffer Create Waves Swift
I have been working in AVAudioPlayer and draw a wave. I am using AudioArmada Github pods to draw waves With the help of AudioArmada Pods. But Some Cases AVAudioFile Crash on reading buffer time.
Code ...
1
vote
0
answers
63
views
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 ...
4
votes
0
answers
177
views
Change encoder format version
I have, for the past week, been trying to take audio from the microphone (on iOS), down sample it and write that to a '.aac' file.
I've finally gotten to point where it's almost working
let ...
4
votes
2
answers
2k
views
Error when installing a tap on audio engine input node
whenever the code reaches
inputNode.installTap(onBus: 0, bufferSize: 1024, format: recordingFormat) {[weak self] (buffer:AVAudioPCMBuffer, when:AVAudioTime), app is crashing with following error
...
0
votes
1
answer
1k
views
Play an audio file using Swift for MacOS
I'm trying to simply play a file (in the main bundle or on the disk) using AVAudioFile, AVAudioEngine and AVAudioPlayerNode.
Here is what I'm doing:
import Foundation
import AppKit
import ...
5
votes
1
answer
5k
views
Writing AVAudioPCMBuffer into an AVAudioFile compressed
We're working on an application which records and persists microphone input. The use of AVAudioRecorder was not an option, because real-time audio processing is needed.
AVAudioEngine is used because ...
1
vote
0
answers
84
views
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 ...
1
vote
2
answers
1k
views
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. ...
0
votes
1
answer
635
views
Play audio from float arrays iOS Swift
I have 2 float arrays one representing the left channel values and the other representing the right channel values. How can I create and play music from these two arrays?(Sample Rate = 44100) TIA
2
votes
0
answers
744
views
AVAudioFIle Read iOS swift Normalisation
When i try to read an audio file in swift using AVAudioFile.read() all the amplitude values are between -1 and 1.But when i read the values in python using librosa library i get different amplitude ...
3
votes
1
answer
3k
views
Converting AVAudioPCMBuffer to another AVAudioPCMBuffer
I am trying to convert a determined AVAudioPCMBuffer (44.1khz, 1ch, float32, not interleaved) to another AVAudioPCMBuffer (16khz, 1ch, int16, not interleaved) using AVAudioConverter and write it using ...
-1
votes
2
answers
200
views
Can't play sound in java using clip
I want to play some sound in java using this code bellow. That sound is in WAV format so I think that this code should work fine, but instead of playing sound it simply does nothing. There is no even ...
2
votes
1
answer
542
views
Filtering frequencies from .m4a data
I'm trying to analyze a sound file (.m4a) to get the amplitudes over time and make a graph. I found some code online that works great (below). However, I would like to additionally filter out all ...
4
votes
1
answer
760
views
Read an AVAudioFile into a buffer starting at a certain time
Let's say I have an AVAudioFile with a duration of 10 seconds. I want to load that file into an AVAudioPCMBuffer but I only want to load the audio frames that come after a certain number of seconds/...
0
votes
0
answers
908
views
How to read an AVAudioFile into the same AVAudioPCMBuffer multiple times?
EDIT:
I was able to prevent readIntoBuffer from returning false by adding audioFileB.framePosition = 0; at the end of my for loop. However, now it looks like bufferB only contains audio from the final ...
0
votes
1
answer
633
views
How can I play multiple different audio files from same AVAudioEngine? (Error: !nodeimpl->HasEngineImpl())
In my app I want to play a different audio file every time a different cell in the table view is pressed. Below is my implementation but I keep receiving the error:
Terminating app due to uncaught ...
4
votes
1
answer
2k
views
How can I play a sound from the asset catalog using AVAudioPlayerNode?
I'm trying to use an AVAudioPlayerNode to play sounds from the Assets.xcassets asset catalog, but I can't figure out how to do it.
I've been using AVAudioPlayer, which can be initialized with an ...
6
votes
3
answers
5k
views
How to search the error code of 'com.apple.coreaudio.avfaudio'?
Where could I get the information of com.apple.coreaudio.avfaudio error codes, such as:
Terminating app due to uncaught exception 'com.apple.coreaudio.avfaudio', reason: 'error -50'
I always get ...
4
votes
0
answers
761
views
IOS copying a part of AVAudioPCMBuffer to another
I have AVAudioPCMBuffer which I want to copy a portion of to other buffer (cutting some part of the voice from the end of it )
let samples = Array(UnsafeBufferPointer(start: buffer....
1
vote
1
answer
491
views
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 ...
2
votes
2
answers
1k
views
AVAudioFile init works on simulator but crashes on device
I want to build an iOS app (using Swift 3 and Xcode 8.2.1) that records from the microphone of an iPhone and saves the record to a .caf file.
First, I've added the following lines to the Info.plist ...
0
votes
1
answer
1k
views
swift FFT chunk audio file to get Amplitude
i need your help. in want to use the FFT on my audio file. i want to cut my audio file in more little buffer array and use my FFT with all sub buffer.
why ?? because i need to know and see (with ...
4
votes
2
answers
671
views
iOS Swift malloc error
I want to record audio on iOS in real time, analyze the raw audio data and save parts of the recorded data. I'm recording the data with this code: https://gist.github.com/hotpaw2/...
2
votes
3
answers
3k
views
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
...
2
votes
2
answers
1k
views
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];
...
1
vote
1
answer
452
views
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 ...
4
votes
1
answer
1k
views
AVAudioFile doesn't play in AVAudioEngine
I'm attempting to play an AVAudioFile using the AVAudioEngine. The code is largely taken and adapted from the Apple Developer on-line videos, but there is no playback. Have spent some time going ...
5
votes
0
answers
149
views
During cascading 2 audio files tracksWithMediaType always returns empty array
I have 2 audio files audioFile1.m4a and audioFile2.m4a. I want to create a cascaded audio combined.m4a which contains audioFile1.m4a and audioFile2.m4a, one after another. I used below code and my ...
0
votes
2
answers
2k
views
can't find audio file after recording
i created a voice recorder in android studio, but i cant find the recorded file on my phone. normally am meant to attach it to an email that will be sent, but i cant find it on my phone for me to add ...