|
13 | 13 | *
|
14 | 14 | */
|
15 | 15 | class PortAudioInfo : public AudioBaseInfo {
|
16 |
| - bool is_input = false; |
17 |
| - bool is_output = true; |
| 16 | + public: |
| 17 | + bool is_input = false; |
| 18 | + bool is_output = true; |
18 | 19 | };
|
19 | 20 |
|
20 | 21 | /**
|
@@ -49,20 +50,17 @@ class PortAudioStream : BufferedStream {
|
49 | 50 |
|
50 | 51 | /* Open an audio I/O stream. */
|
51 | 52 | err = Pa_OpenDefaultStream( &stream,
|
52 |
| - info.is_input ? info.channels : 0, /* no input channels */ |
53 |
| - info.is_output ? info.channels : 0, /* stereo output */ |
54 |
| - getFormat(info.bits_per_sample), /* 32 bit integer */ |
55 |
| - info.sample_rate, |
56 |
| - paFramesPerBufferUnspecified, /* frames per buffer, i.e. the number |
57 |
| - of sample frames that PortAudio will |
58 |
| - request from the callback. Many apps |
59 |
| - may want to use |
60 |
| - paFramesPerBufferUnspecified, which |
61 |
| - tells PortAudio to pick the best, |
62 |
| - possibly changing, buffer size.*/ |
63 |
| - nullptr, /* this is your callback function */ |
64 |
| - nullptr ); /*This is a pointer that will be passed to |
65 |
| - your callback*/ |
| 53 | + info.is_input ? info.channels : 0, /* no input channels */ |
| 54 | + info.is_output ? info.channels : 0, /* stereo output */ |
| 55 | + getFormat(info.bits_per_sample), |
| 56 | + info.sample_rate, |
| 57 | + paFramesPerBufferUnspecified, /* frames per buffer, i.e. the number |
| 58 | + of sample frames that PortAudio will |
| 59 | + request from the callback. Many apps |
| 60 | + may want to use*/ |
| 61 | + nullptr, /* this is your callback function */ |
| 62 | + nullptr ); /*This is a pointer that will be passed to |
| 63 | + your callback*/ |
66 | 64 | if( err != paNoError ) {
|
67 | 65 | LOGE( "PortAudio error: %s\n", Pa_GetErrorText( err ) );
|
68 | 66 | }
|
@@ -90,7 +88,6 @@ class PortAudioStream : BufferedStream {
|
90 | 88 | PaError err = paNoError;
|
91 | 89 | PortAudioInfo info;
|
92 | 90 |
|
93 |
| - |
94 | 91 | virtual size_t writeExt(const uint8_t* data, size_t len) {
|
95 | 92 | size_t result = 0;
|
96 | 93 | if (stream!=nullptr){
|
|
0 commit comments