MCPcopy Create free account
hub / github.com/OpenApoc/OpenApoc / SDLSampleData

Method SDLSampleData

framework/sound/sdlraw_backend.cpp:87–97  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

85{
86 public:
87 SDLSampleData(sp<Sample> sample, SDL_AudioSpec &output_spec)
88 {
89 unsigned long int input_size =
90 sample->format.getSampleSize() * sample->format.channels * sample->sampleCount;
91 this->samples.resize(input_size);
92 memcpy(this->samples.data(), sample->data.get(), input_size);
93 if (!ConvertAudio(sample->format, output_spec, input_size, this->samples))
94 {
95 LogWarning("Failed to convert sample data");
96 }
97 }
98 ~SDLSampleData() override = default;
99 std::vector<unsigned char> samples;
100};

Callers

nothing calls this directly

Calls 3

ConvertAudioFunction · 0.85
getSampleSizeMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected