Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split Audio Dumps on Sample Rate Changes #3891

Merged

Conversation

RisingFog
Copy link
Member

@RisingFog RisingFog commented Jun 11, 2016

This is somewhat of a port of the dolphin-avsync functionality of splitting audio files based on sample rate changes. It's also an alternative to PR #3542, which would resample all audio to 48khz.


This change is Reviewable

@RisingFog RisingFog force-pushed the split_audio_dump_sample_rate branch 4 times, most recently from cf9c938 to 8b77645 Compare June 11, 2016 23:07
basename.replace(0, filepath.length(), "");
basename.replace(basename.end() - 4, basename.end(), "");
}
current_sample_rate = HLESampleRate;

This comment was marked as off-topic.

This comment was marked as off-topic.

@RisingFog RisingFog force-pushed the split_audio_dump_sample_rate branch 2 times, most recently from 35d6b3d to f20063d Compare June 12, 2016 14:47
@lioncash
Copy link
Member

Review status: 0 of 4 files reviewed at latest revision, 5 unresolved discussions.


Source/Core/AudioCommon/Mixer.h, line 60 [r2] (raw file):

      unsigned int Mix(short* samples, unsigned int numSamples, bool consider_framelimit = true);
      void SetInputSampleRate(unsigned int rate);
      unsigned int GetInputSampleRate();

This can be const qualified


Source/Core/AudioCommon/WaveFile.cpp, line 113 [r2] (raw file):

  }

  if (sample_rate != current_sample_rate)

This and the code below should be extracted to their own function. This literally do the same thing


Comments from Reviewable

@RisingFog RisingFog force-pushed the split_audio_dump_sample_rate branch from f20063d to 0d4b86b Compare June 13, 2016 13:04
@RisingFog
Copy link
Member Author

Review status: 0 of 4 files reviewed at latest revision, 5 unresolved discussions.


Source/Core/AudioCommon/Mixer.h, line 60 [r2] (raw file):

Previously, lioncash (Mat M.) wrote…

This can be const qualified

Done.

Source/Core/AudioCommon/WaveFile.cpp, line 45 [r1] (raw file):

Previously, BhaaLseN (BhaaL) wrote…

My bad. /me hides

You could look into using StringUtil::SplitPath tho.

Done.

Source/Core/AudioCommon/WaveFile.cpp, line 113 [r2] (raw file):

Previously, lioncash (Mat M.) wrote…

This and the code below should be extracted to their own function. This literally do the same thing

Done.

Comments from Reviewable

@lioncash
Copy link
Member

Source/Core/AudioCommon/Mixer.h, line 60 [r2] (raw file):

Previously, RisingFog (Chris Burgener) wrote…

Done.

I had meant like:
unsigned int GetInputSampleRate() const;

Comments from Reviewable

@RisingFog RisingFog force-pushed the split_audio_dump_sample_rate branch from 0d4b86b to bd57dc6 Compare June 13, 2016 13:14
@RisingFog
Copy link
Member Author

Review status: 0 of 4 files reviewed at latest revision, 4 unresolved discussions.


Source/Core/AudioCommon/Mixer.h, line 60 [r2] (raw file):

Previously, lioncash (Mat M.) wrote…

I had meant like:

unsigned int GetInputSampleRate() const;
Done.

Comments from Reviewable

@RisingFog RisingFog force-pushed the split_audio_dump_sample_rate branch from bd57dc6 to 06035b2 Compare June 25, 2016 01:09
@RisingFog RisingFog force-pushed the split_audio_dump_sample_rate branch from 06035b2 to ca2eaac Compare June 25, 2016 01:12
@degasus
Copy link
Member

degasus commented Jun 28, 2016

:lgtm:


Reviewed 4 of 4 files at r5.
Review status: all files reviewed at latest revision, 2 unresolved discussions.


Source/Core/AudioCommon/WaveFile.cpp, line 122 [r5] (raw file):

}

void WaveFileWriter::AddStereoSamplesBE(const short* sample_data, u32 count, int sample_rate)

IMO AddStereoSamplesBE and AddStereoSamples should be merged, but this should be done in the next PR.


Comments from Reviewable

@RisingFog RisingFog merged commit 4133575 into dolphin-emu:master Jun 28, 2016
@RisingFog RisingFog deleted the split_audio_dump_sample_rate branch June 28, 2016 15:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants