Conversation

Is it reasonable to load an entire song into RAM in a music player written in otherwise highly optimized C code?

50% Yes
50% No
0
0
0

I should note: unless I did the math wrong (which is possible!), a 10 minute song in 32-bit 48khz is still less than 256mb of RAM, which is perfectly fine for the target hardware in this case.

1
0
0

Also, loading it all into a buffer would help with smooth and seamless playback.

It's a tradeoff, I guess.

1
0
0

@hexaheximal I guess it depends on the targetted users / device. A phone with 512MB of RAM that someone just wants to play music on as a dedicated music player might not do so well.

1
0
0

@hexaheximal perhaps detecting the amount of free RAM would be a good check before loading it all in.

0
0
0
@hexaheximal mmap! (but even without that, why do you need to load the entire song into a buffer at once?)
1
0
1

@noisytoot tinyalsa seems to not like streaming audio.

however, after trying the full-song buffer approach, it doesn't like that either???

1
0
1