When I add a StreamAudio object I lose the COM port.
I thought that the teensy was fried and almost tossed it...
I first wrote a small example using the same technique (I am not a C++ wizard, and never thought about writing my own Audiostream object...) and it works fine, so there must be something else that I am doing wrong.
I compile with USB Type: Serial+Audio+Midi
This is my class definition
If I remove the class and I just compile with
void audio_update () { //sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) {
}
then I have no issues with loading the sketch in Teensy 4.1.
Any ideas?
Thanks much!
(The code is here
https://github.com/alfa95139/AlfaSoniQMirage/tree/teensy_41_with_emulator
check doc5503.cpp and doc5503.h)
I thought that the teensy was fried and almost tossed it...
I first wrote a small example using the same technique (I am not a C++ wizard, and never thought about writing my own Audiostream object...) and it works fine, so there must be something else that I am doing wrong.
I compile with USB Type: Serial+Audio+Midi
This is my class definition
Code:
include <Arduino.h>
#include "bus.h"
#include "AudioStream.h"
#include "arm_math.h"
class Q : public AudioStream
{
public:
Q(void) : AudioStream (2, outputQueueArray) { }
virtual void update(void);
void begin(void);
private:
audio_block_t *outputQueueArray[2];
};
My understanding is that this way I create a class with two output queues.
This is the definition of the Object in the program:
#include <Audio.h>
#include <Wire.h>
Q *Qchip;
Q DOC_output; // Queue for DOC
AudioOutputPT8211 pt8211_1;
AudioConnection patchCord1(DOC_output, 0, pt8211_1, 0);
AudioConnection patchCord2(DOC_output, 1, pt8211_1, 1);
void doc_init() {
Qchip = new Q();
AudioMemory(64); // reserve some Teensy mem for audio purposes...
...
}
void Q::update (void) { //sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) {
...
}
void audio_update () { //sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) {
}
then I have no issues with loading the sketch in Teensy 4.1.
Any ideas?
Thanks much!
(The code is here
https://github.com/alfa95139/AlfaSoniQMirage/tree/teensy_41_with_emulator
check doc5503.cpp and doc5503.h)
Last edited by a moderator: