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 to go about this especially in swift. I know the file is playable on any media player I have tried, but when I try to use any AVAudioFile object to convert it "fails to create the audio file". Here is all the information about the file I managed to find from here:
ANY help or insight is much appreciated!
file_name: recording.aac
file_size: 130 kB
mime_type: application/octet-stream
category: application
type: octet-stream
streams:
index: 0
codec_name: aac
codec_long_name: AAC (Advanced Audio Coding)
profile: LC
codec_type: audio
codec_tag_string: [0][0][0][0]
codec_tag: 0x0000
sample_fmt: fltp
sample_rate: 48000
channels: 2
channel_layout: stereo
bits_per_sample: 0
initial_padding: 0
r_frame_rate: 0/0
avg_frame_rate: 0/0
time_base: 1/28224000
duration_ts: 228572030
duration: 8.098499
bit_rate: 128895
format
nb_streams: 1
nb_programs: 0
format_name: aac
format_long_name: raw ADTS AAC (Advanced Audio Coding)
duration: 8.098499
size: 130500
bit_rate: 128912
probe_score: 50
raw_header:
EB 3B 81 0C 8A 61 16 56 0C 45 A1 96 40 05 FC 64 D5 F1 FF F1 4C 80 29 A1 AC 21 1A D5 25 8A 98 C9 82 A9 48 82 40 12 A7 0E 27 34 A9 57 54 5A A4 A8 89 51 2A 29 16 19 6E 4F C4 97 D6 99 D5 FB 5F A5 50 EF D4 EF 1D 62 9B 34 9A 32 C1 4C DE 40 2D 50 8C C1 34 95 7A C2 A3 C8 A7 EA 5E 94 1D 94 72 A6 7E 07 CE D5 AE 23 56 33 39 76 FA 3E 53 6B 9F 0D 77 1C C7 4D 78 22 86 DC 48 59 E9 F4 CA DE C8 62
Realized that my .aac file was incorrectly formatted. The metadata for the audio was in the file, but couldn't be read because it wasn't at the very front, (there were some relics from a previous frame inserted in the beginning before the first header). The fix for this file was to make a function that deleted any data before the first header (signaled by FFF1).