A class which creates an image of the spectrum of a given file This is not used to compute features, that's just a tool. More...
#include <spectrumrecorder.h>
Public Member Functions | |
| SpectrumRecorder (int windowSize=1024, int sampleFrequency=-1, int maxHeight=1024, int scale=1) | |
| Default constructor. Sets up the computation. | |
| ~SpectrumRecorder () | |
| Destructor. | |
| void | setup (int windowSize=1024, int sampleFrequency=-1, int maxHeight=1024, int scale=1) |
| Sets up the processing. | |
| bool | compute (string file) |
| Computes the spectrum. | |
| void | useBuffer () |
| Write the image (internal) | |
| void | sequenceEnds () |
| Callback called when the file ended. | |
| void | writeToFile (string file) |
| Write down the image. | |
Public Member Functions inherited from StreamPlayer | |
| StreamPlayer (bool live=false, bool verbose=true) | |
| Default constructor. Starts VLC instance. | |
| ~StreamPlayer () | |
| Default destructor. Frees memory and closes VLC. | |
| string | url () |
| Returns URL of the currently playing stream. | |
| void | setUrl (string url) |
| Defines the URL of the stream to play. | |
| void | setOverlapping (float factor) |
| Turns on / off audio chunk overlapping. | |
| void | setChunkSize (int size) |
| Changes the audio chunk size. | |
| int | chunkSize () |
| Get the current chunk size. | |
| void | play () |
| Plays the media. | |
| libvlc_time_t | playingTime () |
| Returns the playing time. | |
| libvlc_time_t | totalTime () |
| Returns the total time (played + to be played) | |
| void | stop () |
| Stops playing. | |
| bool | isLive () |
| Are we playing a live stream ? | |
| void | setVolume (int vol) |
| Changes the volume (between 0 and 100) | |
| int | volume () |
| Gets the current volume. | |
| virtual void | sequenceStarts () |
| Callback called when we start playing a file. | |
| void | watch () |
| Watching thread. | |
| uint16_t | buffer (int i) |
| Buffer acces (for the user) | |
| int | bufferSize () |
| Current buffer size (internal) | |
| void | fillBuffer (uint16_t value) |
| Fill buffer with a new value (internal) | |
| void | flushBuffer () |
| Flush buffer (just keep the overlapping part) | |
Additional Inherited Members | |
Static Public Member Functions inherited from StreamPlayer | |
| static uint16_t * | convert8to16 (const uint8_t *source, int size) |
| Converts an array of uint8_t to another array of uint16_t (assuming the values are coded on two bytes) The returned pointer has to be deleted by the user. | |
| static uint16_t * | average (uint16_t *source, int size, int passes, int scale=1) |
| Computes the average value of the stream, on a given frequency The returned pointer has to be deleted by the user. | |
| static void | reduce (uint16_t *source, uint16_t *dest, int size, int passes, int scale=1) |
| Reduces the stream, keeping only the extreme values. | |
| static void | addOffset (uint16_t *source, uint16_t *dest, int size, int offset) |
| Adds an offset to each value of the array. | |
| static int | pow2 (int n) |
| Get 2^n. | |
Public Attributes inherited from StreamPlayer | |
| std::deque< uint16_t > | mBuffer |
| Feature extraction : those variables need to be public (I know, I can write accessors...) | |
| QMutex | mLock |
| char * | mAudioData |
| unsigned int | mAudioDataSize |
| unsigned int | mFrequency |
Protected Attributes inherited from StreamPlayer | |
| bool | mVerbose |
A class which creates an image of the spectrum of a given file This is not used to compute features, that's just a tool.
1.8.1.1