| 636 | } |
| 637 | |
| 638 | size_t Audio::read(int16_t* buffer, size_t bufferSize) { |
| 639 | if (bufferSize == 0) |
| 640 | return 0; |
| 641 | |
| 642 | size_t readTotal = 0; |
| 643 | while (readTotal < bufferSize) { |
| 644 | size_t toGo = bufferSize - readTotal; |
| 645 | size_t ramt = readPartial(buffer + readTotal, toGo); |
| 646 | readTotal += ramt; |
| 647 | // End of stream reached |
| 648 | if (ramt == 0) |
| 649 | break; |
| 650 | } |
| 651 | return readTotal; |
| 652 | } |
| 653 | |
| 654 | size_t Audio::resample(unsigned destinationChannels, unsigned destinationSampleRate, int16_t* destinationBuffer, size_t destinationBufferSize, double velocity) { |
| 655 | unsigned destinationSamples = destinationBufferSize / destinationChannels; |
no outgoing calls
no test coverage detected