|
VirtualC64 v5.0 beta
Commodore 64 Emulator
|
Audio Port Public API. More...
#include <VirtualC64.h>
Public Member Functions | |
| AudioPortStats | getStats () const |
| Returns statistical information about the components. | |
Retrieving audio data | |
| isize | copyMono (float *buffer, isize n) |
| Extracts a number of mono samples from the audio buffer Internally, the audio port maintains a ringbuffer storing stereo audio samples. | |
| isize | copyStereo (float *left, float *right, isize n) |
| Extracts a number of stereo samples from the audio buffer. | |
| isize | copyInterleaved (float *buffer, isize n) |
| Extracts a number of stereo samples from the audio buffer. | |
Visualizing waveforms | |
| float | draw (u32 *buffer, isize width, isize height, float maxAmp, u32 color, isize sid=-1) const |
| Draws a visual representation of the waveform. | |
Audio Port Public API.
| isize copyInterleaved | ( | float * | buffer, |
| isize | n ) |
Extracts a number of stereo samples from the audio buffer.
This function has to be used if a stereo stream is managed in a single destination buffer. The samples of both channels will be interleaved, that is, a sample for the left channel will be followed by a sample of the right channel and vice versa.
| buffer | Pointer to the destinationleft buffer. |
| n | Number of sound samples to copy. |
| isize copyMono | ( | float * | buffer, |
| isize | n ) |
Extracts a number of mono samples from the audio buffer Internally, the audio port maintains a ringbuffer storing stereo audio samples.
When this function is used, both internal stream are added together and written to to the destination buffer.
| buffer | Pointer to the destination buffer |
| n | Number of sound samples to copy. |
| isize copyStereo | ( | float * | left, |
| float * | right, | ||
| isize | n ) |
Extracts a number of stereo samples from the audio buffer.
| left | Pointer to the left channel's destination buffer. |
| right | Pointer to the right channel's destination buffer. |
| n | Number of sound samples to copy. |
| float draw | ( | u32 * | buffer, |
| isize | width, | ||
| isize | height, | ||
| float | maxAmp, | ||
| u32 | color, | ||
| isize | sid = -1 ) const |
Draws a visual representation of the waveform.
The Mac app uses this function to visualize the contents of the audio buffer in one of it's inspector panels.