|
ascii-chat 0.6.0
Real-time terminal-based video chat with ASCII art conversion
|
Simple WAV file writer for audio debugging. More...
Go to the source code of this file.
Data Structures | |
| struct | wav_writer_t |
| WAV file writer context. More... | |
Functions | |
| wav_writer_t * | wav_writer_open (const char *filepath, int sample_rate, int channels) |
| Open WAV file for writing. | |
| int | wav_writer_write (wav_writer_t *writer, const float *samples, int num_samples) |
| Write audio samples to WAV file. | |
| void | wav_writer_close (wav_writer_t *writer) |
| Close WAV file and finalize header. | |
| bool | wav_dump_enabled (void) |
| Check if audio dumping is enabled via environment. | |
Simple WAV file writer for audio debugging.
Provides utilities to dump audio buffers to WAV files for debugging. Enable with environment variable: ASCIICHAT_DUMP_AUDIO=1
Definition in file wav_writer.h.
| bool wav_dump_enabled | ( | void | ) |
Check if audio dumping is enabled via environment.
Definition at line 123 of file wav_writer.c.
References SAFE_GETENV.
Referenced by audio_analysis_init(), and audio_client_init().
| void wav_writer_close | ( | wav_writer_t * | writer | ) |
Close WAV file and finalize header.
| writer | WAV writer context |
Definition at line 99 of file wav_writer.c.
References wav_writer_t::file, SAFE_FREE, and wav_writer_t::samples_written.
Referenced by audio_analysis_cleanup(), audio_cleanup(), audio_client_init(), and client_audio_pipeline_destroy().
| wav_writer_t * wav_writer_open | ( | const char * | filepath, |
| int | sample_rate, | ||
| int | channels | ||
| ) |
Open WAV file for writing.
| filepath | Path to WAV file to create |
| sample_rate | Sample rate (e.g., 44100) |
| channels | Number of channels (1=mono, 2=stereo) |
Definition at line 39 of file wav_writer.c.
References wav_writer_t::channels, wav_data_header_t::data, wav_writer_t::file, wav_fmt_chunk_t::fmt, wav_riff_header_t::riff, SAFE_FREE, SAFE_MALLOC, wav_writer_t::sample_rate, and wav_writer_t::samples_written.
Referenced by audio_analysis_init(), audio_client_init(), and client_audio_pipeline_create().
| int wav_writer_write | ( | wav_writer_t * | writer, |
| const float * | samples, | ||
| int | num_samples | ||
| ) |
Write audio samples to WAV file.
| writer | WAV writer context |
| samples | Float samples in range [-1.0, 1.0] |
| num_samples | Number of samples to write |
Definition at line 85 of file wav_writer.c.
References wav_writer_t::file, and wav_writer_t::samples_written.
Referenced by audio_analysis_track_received_sample(), audio_analysis_track_sent_sample(), audio_process_received_samples(), and client_audio_pipeline_process_duplex().