A
A
Andrew2018-11-22 22:49:19
Objective-C
Andrew, 2018-11-22 22:49:19

Tools for creating an audio message on iOS?

There is an idea to develop a chat with support for audio messages, but for this I need a little help.
At the moment, I have implemented audio recording and displaying a sound wave during recording / reading.
Looking at the applications of Telegram, VK I am interested in a couple of questions:
1) When loading a chat, all audio messages are instantly presented with a sound wave. How are these types of messages handled?
I can get NSData by url and then get buffer. After that, using Accelerate, I can get the data and draw this sound wave. But for a huge number of messages, it will take a huge amount of time. Are there any alternative solutions?
2) should I use AVAudioPlayer to play remote audio files with preliminary receipt of NSData and play it, or is it better to use AVPlayer? But in this regard, how to get a buffer for rendering a sound wave
Thank you!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Donkovtsev, 2018-11-24
@Demetriy

1) I'll tell you a secret, the sound wave is not parsed from the sound file, but is stored as a separate field (at least in telegram), which is sent by the application itself when the file is loaded, i.e. if it does not send, then there will be no sound wave.
2) If we are talking about audio messages (short, VERY small files), then it seems to me that it is easier to download them immediately and play a local file.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question