MCPcopy Create free account
hub / github.com/AbyssEngine/AbyssEngineOld / getAudioSample

Method getAudioSample

src/Abyss/Streams/VideoStream.cpp:270–278  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

268void VideoStream::stopVideo() { _isPlaying = false; }
269
270short VideoStream::getAudioSample() {
271 uint8_t data[2] = {};
272 _ringBuffer.readData(std::span(data, 2));
273 auto sample = static_cast<int16_t>(static_cast<uint16_t>(data[0] & 0xFF) | static_cast<uint16_t>(data[1]) << 8);
274 if (_separateAudio) {
275 sample += _separateAudio->getSample();
276 }
277 return sample;
278}
279
280bool VideoStream::getIsPlaying() const { return _isPlaying; }
281

Callers 1

fillAudioBufferMethod · 0.80

Calls 2

readDataMethod · 0.80
getSampleMethod · 0.45

Tested by

no test coverage detected