10#ifndef __UTILS_AUDIO_H__
11#define __UTILS_AUDIO_H__
35audio_bit_depth_enum_to_int (
BitDepth depth)
39 case BitDepth::BIT_DEPTH_16:
41 case BitDepth::BIT_DEPTH_24:
43 case BitDepth::BIT_DEPTH_32:
46 g_return_val_if_reached (-1);
51audio_bit_depth_int_to_enum (
int depth)
56 return BitDepth::BIT_DEPTH_16;
58 return BitDepth::BIT_DEPTH_24;
60 return BitDepth::BIT_DEPTH_32;
62 g_return_val_if_reached (BitDepth::BIT_DEPTH_16);
67audio_bit_depth_from_pretty_str (
const char * str);
70audio_bit_depth_to_pretty_str (
BitDepth depth);
88WARN_UNUSED_RESULT
bool
91 size_t frames_already_written,
97 const char * filename,
145 unsigned int samplerate,
146 GArray * candidates);
149audio_file_is_silent (
const char * filepath);
int audio_get_num_cores(void)
Returns the number of CPU cores.
uint_fast64_t unsigned_frame_t
Unsigned type for frame index.
bool audio_frames_equal(const float *src1, const float *src2, size_t num_frames, float epsilon)
Returns whether the frame buffers are equal.
bool audio_files_equal(const char *f1, const char *f2, size_t num_frames, float epsilon)
Returns whether the file contents are equal.
bool audio_frames_empty(float *src, size_t num_frames)
Returns whether the frame buffer is empty (zero).
unsigned_frame_t audio_get_num_frames(const char *filepath)
Returns the number of frames in the given audio file.
float audio_detect_bpm(float *src, size_t num_frames, unsigned int samplerate, GArray *candidates)
Detect BPM.
WARN_UNUSED_RESULT bool audio_write_raw_file(float *buff, size_t frames_already_written, size_t nframes, uint32_t samplerate, bool flac, BitDepth bit_depth, channels_t channels, const char *filename, GError **error)
Writes the buffer as a raw file to the given path.
unsigned int channels_t
Number of channels.