Commit Graph

43 Commits

Author SHA1 Message Date
Henrik Rydgård
1938d3b876 More prep for plugging in alternate audio decoders 2024-04-10 12:14:58 +02:00
Henrik Rydgård
32ca7ab59a Minor code cleanups 2024-04-10 12:07:03 +02:00
Henrik Rydgård
88eb2c2e0b Add a virtual base class so we can implement alternative decoders 2024-04-10 00:45:02 +02:00
Henrik Rydgård
ddbe0e853b Remove unused code 2024-04-10 00:40:16 +02:00
Henrik Rydgård
e19e9b2793 Delete pointless accessors, update some comments 2024-04-10 00:35:48 +02:00
Andrew Udvare
930b7f644d ffmpeg: Improved fix for checking if const AVCodec* is necessary 2024-02-05 14:37:09 -05:00
Andrew Udvare
402f9acb5e Fix compilation with newer ffmpeg versions 2024-01-13 00:12:21 -05:00
Unknown W. Brackets
a7b7bf7826 Global: Set many read-only params as const.
This makes what they do and which args to use clearer, if nothing else.
2022-12-10 21:13:36 -08:00
Henrik Rydgård
e6403d7157 Split GetPointer into two versions, to help with const correctness 2022-07-24 13:26:19 +02:00
Unknown W. Brackets
d45fe93588 Mp3: Output PCM data using even/odd buffer slot.
This makes sense since the audio APIs are all async.
2022-01-27 00:22:44 -08:00
Unknown W. Brackets
4903e14aae Mp3: Cleanup AuCtx constructor. 2022-01-27 00:22:43 -08:00
Henrik Rydgård
3162f30158 Merge base/basictypes.h into Common/Common.h (mostly). 2020-09-29 15:51:51 +02:00
Henrik Rydgård
ff65b813d9 Assorted warning fixes 2019-05-10 23:26:34 +02:00
Unknown W. Brackets
fde59c955d Mp3: Use a vector for the temp buffer.
Hopefully will move to reading RAM directly.  I think this was not always
adding data properly, as I got wrong output after decode.  Makes more
sense as a vector, anyway.
2019-04-29 04:45:36 -07:00
Unknown W. Brackets
ac43e55194 Mp3: Loop correctly from an offset.
If the offset points to an ID3 tag or the middle of a frame, that's fine -
it should just search forward to the next sync.  FFmpeg just returns a
decode error, so we do this first.
2019-04-28 08:35:35 -07:00
Unknown W. Brackets
0d6570e8ad Mp3: Correct sceMp3GetMaxOutputSample.
Was based on output buffer size, rather than frame size, before.

Fixes choppy audio in Velocity.
2019-04-24 14:31:12 -07:00
Unknown W. Brackets
be6710ea4a Mp3: Fix errors for a bunch of init getters. 2019-04-24 14:13:46 -07:00
Unknown W. Brackets
e4d2712897 Mp3: Apply offset to stream read buffer.
Handle errors for sceMp3CheckStreamDataNeeded as well.
2019-04-23 21:14:54 -07:00
Unknown W. Brackets
f9863c3be2 Mp3: Align CheckStreamDataNeeded with InfoToAdd.
May cause problems if they don't match.
2019-04-23 20:42:13 -07:00
Unknown W. Brackets
f1eaf9dc0e Mp3: Don't change buffer accounting until add.
If we just ask what we should add, that is meant to stay static until we
do actually add it.

This also reduces the max we ask for at a time, which better matches
correct behavior and might impact game behavior.
2019-04-23 20:18:16 -07:00
Unknown W. Brackets
0b1102a622 Mpeg: Correctly handle mono audio in videos. 2016-01-21 23:19:03 -08:00
Henrik Rydgård
e632b32be2 Merge pull request #8011 from unknownbrackets/atrac-demux
Manually read packets in sceAtrac, skipping ffmpeg
2015-10-18 20:51:39 +02:00
Lioncash
b1901fbad2 Core: Remove unimplemented class function declarations 2015-10-18 10:55:11 -04:00
Unknown W. Brackets
0e8d3d9c56 Fix leak in FFmpeg codec ctx usage.
Turns out we were leaking these here too.
2015-10-17 16:20:25 -07:00
Unknown W. Brackets
daa90024ed Defer opening audio codec 'til we have block size.
May fix issues with newer versions of FFmpeg (#5772.)
2015-01-18 12:59:26 -08:00
Unknown W. Brackets
47ad97617e Play AT3 files in background audio too.
Fixes 3rd Birthday and PQ2, at least.
2014-06-22 09:55:14 -07:00
Henrik Rydgard
8c36921d3c Have SimpleAudio respect channels/samplerate passed in 2014-06-22 18:33:09 +02:00
Henrik Rydgard
cefc0bc96f Play the game's SND0.AT3 when a game is selected in the menu and on the "game screen". 2014-06-22 17:02:04 +02:00
Henrik Rydgard
12cef8fa80 Oops, buildfixes 2014-06-22 14:23:06 +02:00
Henrik Rydgard
1d0cc3417c Audio stuff: Cleanup, delete dead code 2014-06-22 14:01:23 +02:00
Unknown W. Brackets
c142207a93 Fix a few warnings, mostly type comparisons. 2014-05-31 21:42:57 -07:00
Unknown W. Brackets
95414d6727 Get rid of some duplicate code. 2014-05-29 08:30:00 -07:00
kaienfr
c6a1b0e743 Provide a new method AuCtx::AuCreateCodecContextFromSource()
This method can automatically read audio information from file (as channels, sample rate etc) via ffmpeg,
and create accurate ffmpeg's codec context.
Especially used for unknown audio format but supported  by ffmpeg.
2014-04-14 13:23:10 +02:00
kaienfr
d5fde0baee implement sceMp3GetFrameNum 2014-04-14 11:47:28 +02:00
kaienfr
e25bc6908a Fix nonsmooth sound issue and incomplete frame at the end of source and pcm buffers.
using a std::string to save the source buffer, and changing the loading strategy so as we will not get any incomplete frame.
2014-04-12 23:16:38 +02:00
kaienfr
b3a7568811 change the way in AuGetInfoToAddStreamData and AuNotifyAddStreamData.
readPos and available buffer is firstly updated in AuGetInfoToAddStreamData then notified in AuNotifyAddStreamData.
Since, some games as Dead and alive may not call NotifyAddStreamData after GetInfoToAddStreamData
2014-04-12 14:54:25 +02:00
kaienfr
a7691737b5 Transfer old mp3 savestate into new mode; Rename class functions sceAu... to Au...
Tests on games are just ok.
2014-04-12 02:12:25 +02:00
kaienfr
ee1d541c28 Update minor comments 2014-04-11 23:42:07 +02:00
kaienfr
3a12cf2ad7 Universal Audio Class
Based on my implementation in sceAac https://github.com/hrydgard/ppsspp/pull/5836
I've created a class AuCtx included in My SimpleAudioDec.cpp/.h which aims at providing a standard easy implementation to support all codecs in ffmpeg.
Here, I also completely re-code sceMp3 file with this class to give an example how to use this class, and it has solved all mp3 issues I've observed in the current master.
Tests on different freq and channels mp3 audios as:
Miku custom BGM (48kHz, stereo), Hanayaka Nari Wa ga Ichizoku(32kHz, mono, a little fast but better than before now), downstreet panic (44.1kHz, stereo), and learn jp09(44.1kHz, stero) are just all right.
Especially, I am very glad to see that Miku's Custom BGMs have no repetition issues in first tone any more and no longer stopped in the first second neither. :)
We will come into a new age to fast support new audio formats from now on I hope :P
2014-04-11 22:56:59 +02:00
kaienfr
c216b535ee Save current changes 2014-04-11 15:09:31 +02:00
kaienfr
a576420547 Remove decode function of SimpleAudioDec and use its class method. 2014-04-08 01:09:28 +02:00
kaienfr
c03e591ecd Cleanup SimpleAudioDec
and remove unused AudioCreate fonction, it can be down in the class constructor.
2014-04-01 00:33:46 +02:00
kaienfr
b18252b2b5 Support audio playing (AT3, AT3+, Mp3, AAC) 2014-03-23 19:45:08 +01:00