We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
The second float cast is in the wrong place. https://github.com/lancaster-university/codal-core/blob/509086cc8590465041b15493ab52b56e7071c110/source/streams/StreamRecording.cpp#L65
The text was updated successfully, but these errors were encountered:
Created PR lancaster-university/codal-core#172
With the test below... before the change
Recording length: 11098 bytes Recording rate: 11000 Hz Recording duration: 672 ms
After the change
Recording length: 11036 bytes Recording rate: 11000 Hz Recording duration: 1003 ms
#include "MicroBit.h" #include "StreamRecording.h" #include "SerialStreamer.h" MicroBit uBit; int main() { uBit.init(); static SplitterChannel *splitterChannel = uBit.audio.splitter->createChannel(); splitterChannel->requestSampleRate(11000); static StreamRecording *recording = new StreamRecording(*splitterChannel); static MixerChannel *mixerChannel = uBit.audio.mixer.addChannel(*recording, recording->getSampleRate()); static SerialStreamer *streamer = new SerialStreamer(*recording, SERIAL_STREAM_MODE_DECIMAL); MicroBitAudio::requestActivation(); mixerChannel->setVolume(75.0); uBit.audio.mixer.setVolume(1023); uBit.serial.printf("Recording rate: %d\n", (int)recording->getSampleRate()); uBit.serial.printf("Mixer rate: %d\n", (int)uBit.audio.mixer.getSampleRate()); while (true) { if (uBit.buttonA.isPressed()) { uBit.sleep(500); uBit.display.print("R"); recording->recordAsync(); uBit.sleep(1000); recording->stop(); uBit.serial.printf("Recording length: %d bytes\n", (int) recording->length()); uBit.serial.printf("Recording rate: %d Hz\n", (int) recording->getSampleRate()); uBit.serial.printf("Recording duration: %d ms\n", (int) ( 1000 * recording->duration( recording->getSampleRate()))); } else if (uBit.buttonB.isPressed()) { uBit.display.print("P"); recording->connect(*mixerChannel); recording->play(); } else if (uBit.logo.isPressed()) { recording->connect(*streamer); recording->play(); } uBit.display.clear(); uBit.sleep(100); } }
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
The second float cast is in the wrong place.
https://github.com/lancaster-university/codal-core/blob/509086cc8590465041b15493ab52b56e7071c110/source/streams/StreamRecording.cpp#L65
The text was updated successfully, but these errors were encountered: