Commit Graph

179 Commits

Author SHA1 Message Date
Mahyar Koshkouei
b0a1eb8283 Add flac support
Not working properly due to decoding flac in to 32 bit buffer instead of
16 bit.

Signed-off-by: Mahyar Koshkouei <deltabeard@users.noreply.github.com>
2016-12-21 20:25:26 +00:00
Mahyar Koshkouei
a6c43d6a7c Add flac lib
Signed-off-by: Mahyar Koshkouei <deltabeard@users.noreply.github.com>
2016-12-21 16:57:23 +00:00
Mahyar Koshkouei
70e920cec6 Minor changes to debug
Added text to show that playback is paused.
Still attempting to add Opus.

Signed-off-by: Mahyar Koshkouei <deltabeard@users.noreply.github.com>
2016-12-21 16:54:21 +00:00
Mahyar Koshkouei
7e33638380 Attempting to play opus on the fly
This doesn't work yet.

Signed-off-by: Mahyar Koshkouei <deltabeard@users.noreply.github.com>
2016-12-21 16:54:16 +00:00
Mahyar Koshkouei
2805088a4a Opus to Wav working example
Signed-off-by: Mahyar Koshkouei <deltabeard@users.noreply.github.com>
2016-12-21 16:53:40 +00:00
Mahyar Koshkouei
78a874f2c0 Add POC that converts Opus to Wav
Signed-off-by: Mahyar Koshkouei <deltabeard@users.noreply.github.com>
2016-12-21 16:53:40 +00:00
Mahyar Koshkouei
1f4b29912b Adding Opus
Signed-off-by: Mahyar Koshkouei <deltabeard@users.noreply.github.com>
2016-12-21 16:53:40 +00:00
Mahyar Koshkouei
1cd932be7b Add preliminary Opus file support
Signed-off-by: Mahyar Koshkouei <deltabeard@users.noreply.github.com>
2016-12-21 16:53:40 +00:00
Mahyar Koshkouei
6c43254b7e Add libopus to project
Use https://github.com/deltabeard/3ds_portlibs to obtain libopus.

Signed-off-by: Mahyar Koshkouei <deltabeard@users.noreply.github.com>
2016-12-21 16:53:40 +00:00
Mahyar Koshkouei
ce38c691db Fix PCM16 being stored in unsigned array
Fixed an issue whereby signed PCM16 sample data was being stored in an
unsigned array. Sound quality doesn't seem to have been affected.

Signed-off-by: Mahyar Koshkouei <deltabeard@users.noreply.github.com>
2016-12-11 11:40:51 +00:00
Mahyar Koshkouei
7a08c05e1a Minor change to buffer size
Set buffer size back to set value rather than bases on values obtained
from file.
Fixed some indentation and removed some old debugging chaff.

Signed-off-by: Mahyar Koshkouei <deltabeard@users.noreply.github.com>
2016-12-04 13:29:54 +00:00
Mahyar Koshkouei
3c49a862c3 Fix replay last buffer issue
Fixed a bug whereby the last part of the file may be play twice.
Additionally changed the buffer size to the sample size of the wav file.
This is so that there is little delay when pausing.

Signed-off-by: Mahyar Koshkouei <deltabeard@users.noreply.github.com>
2016-12-04 11:32:59 +00:00
Mahyar Koshkouei
ef6242a0d5 Update README.md 2016-12-04 10:15:31 +00:00
Mahyar Koshkouei
29b3031950 Merge branch 'ndsp' 2016-12-04 09:52:20 +00:00
Mahyar Koshkouei
d1902617ee Add pause/play support
Pressing A now pauses and plays the selected file.
Reduced buffer size from 1MiB to 16KiB.

Signed-off-by: Mahyar Koshkouei <deltabeard@users.noreply.github.com>
2016-12-04 09:41:38 +00:00
Mahyar Koshkouei
462261e781 Change interpolation to polyphase
Signed-off-by: Mahyar Koshkouei <deltabeard@users.noreply.github.com>
2016-12-03 14:27:26 +00:00
Mahyar Koshkouei
d3df928cae Fix crash on fopen error
Fixed an issue whereby the return value of fopen was not checked for a
NULL pointer causing a crash. This error occurred when opening a file
with the character "é", when it was the first file opened when starting
the program.
Error messages now report the errno string.
Added preliminary stream support.

Signed-off-by: Mahyar Koshkouei <deltabeard@users.noreply.github.com>
2016-12-03 13:57:29 +00:00
Mahyar Koshkouei
856034ad63 Many fixes
Now using dynamic allocation for file name.
Sleep mode disabled to allow playing of music whilst lid is closed via
headphones.
Fixed an issue where the 3DS screens would not appear when coming back
from sleep mode.
Fixed an issue where music may immediately stop playing after trying to
play it.
Music can now be listened to when the 3DS has its lid closed.
Fixed an issue whereby the number of sample in the buffer was
miscalculated.
Music can now be played by pressing the R button, even when the 3DS lid
is closed. Selecting a file still has to be done with the d-pad.

Tested working on new 3DS. Only the first 8MiB of a wav file is
currently played.

Signed-off-by: Mahyar Koshkouei <deltabeard@users.noreply.github.com>
2016-12-03 00:14:17 +00:00
Mahyar Koshkouei
c31c872621 Use DSP instead of CSND
Signed-off-by: Mahyar Koshkouei <deltabeard@users.noreply.github.com>
2016-11-22 23:58:44 +00:00
Mahyar Koshkouei
c346f60f16 Add icon
Signed-off-by: Mahyar Koshkouei <deltabeard@users.noreply.github.com>
2016-11-21 21:44:40 +00:00
Mahyar Koshkouei
c05e4366f7 Disable 8bit WAV support
8 bit, and ADPCM wav files sound like garbage, so disabling it.
Changed directory to "MUSIC".
Minor changes to file selector.

Signed-off-by: Mahyar Koshkouei <deltabeard@users.noreply.github.com>
2016-10-28 13:17:48 +01:00
Mahyar Koshkouei
fcc801e8ca Working release before Stereo support changes
Added work-around for stereo WAV files. Plays them twice as fast to
compensate for the fact the player currently only supporting monophonic
output. Stereo output will be added in the future.

WAV sampling rate, resolution, channels, etc is now automatically
detected. Note that 8bit WAV files sound horrible for some reason.

Note that PCM WAV files are supported, not compressed WAV files.

Tested working on n3DS and 3DS.

Signed-off-by: Mahyar Koshkouei <deltabeard@users.noreply.github.com>
2016-10-28 11:55:37 +01:00
Mahyar Koshkouei
31ad76e541 Attempting to add Stereo
Signed-off-by: Mahyar Koshkouei <deltabeard@users.noreply.github.com>
2016-10-28 11:46:09 +01:00
Mahyar Koshkouei
b60cec86b9 Player fixes and file selector
Fixed an issue where the first part of a WAV file would not be played.
Fixed an issue where a random part of the WAV file would play after the
file had finished playing.
Fixed an issue where the audio file was not closed after it had finished
playing.
Fixed an issue whereby the current file would continue playing after
returning to the main menu.

Added basic file selector to select different WAV audio files in the
/audio/ folder.
Now using two buffers to play audio. Whilst one buffer is playing, the
other buffer is played. Buffer size set to a magic value of 1MiB.

Tested on New 3DS. Currently working with 48000Hz, 16 Bit WAV files.

TODO (in order):
Refactor duplicate code.
Automatically detect WAV sampling rate, resolution, etc.
Remove debug messages.
Add file browser.

Signed-off-by: Mahyar Koshkouei <deltabeard@users.noreply.github.com>
2016-10-25 23:30:50 +01:00
Mahyar Koshkouei
69cd402df1 goto cleanup and define
Removed pointless goto.
Made use of BUFFER_SIZE define.

Untested.

Signed-off-by: Mahyar Koshkouei <deltabeard@users.noreply.github.com>
2016-10-24 23:08:22 +01:00
Mahyar Koshkouei
7fe6bc50ac Remove some debug
Still a lot of debug remaining. Removed some pointless lines in the
meantime.

Signed-off-by: Mahyar Koshkouei <deltabeard@users.noreply.github.com>
2016-10-24 23:03:47 +01:00
Mahyar Koshkouei
e9a618b940 Load large WAV files
Large WAV files can now be played. Tested working with 77MiB WAV files.

Known issues:
- First kilobytes of WAV file isn't played.
- Screen doesn't turn on after 3DS placed in sleep mode.

Signed-off-by: Mahyar Koshkouei <deltabeard@users.noreply.github.com>
2016-10-24 23:00:32 +01:00
Mahyar Koshkouei
020ade0934 Create initial file structure
Signed-off-by: Mahyar Koshkouei <deltabeard@users.noreply.github.com>
2016-10-24 11:52:11 +01:00
Mahyar Koshkouei
c9729ed113 Initial commit 2016-10-23 19:40:56 +01:00