Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sync : whisper.cpp #1137

Merged
merged 2 commits into from
Mar 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 0 additions & 15 deletions examples/common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -609,21 +609,6 @@ gpt_vocab::id gpt_sample_top_k_top_p_repeat(

}

bool is_wav_buffer(const std::string buf) {
// RIFF ref: https://en.wikipedia.org/wiki/Resource_Interchange_File_Format
// WAV ref: https://www.mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/WAVE.html
if (buf.size() < 12 || buf.substr(0, 4) != "RIFF" || buf.substr(8, 4) != "WAVE") {
return false;
}

uint32_t chunk_size = *reinterpret_cast<const uint32_t*>(buf.data() + 4);
if (chunk_size + 8 != buf.size()) {
return false;
}

return true;
}

void high_pass_filter(std::vector<float> & data, float cutoff, float sample_rate) {
const float rc = 1.0f / (2.0f * M_PI * cutoff);
const float dt = 1.0f / sample_rate;
Expand Down
3 changes: 0 additions & 3 deletions examples/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,6 @@ gpt_vocab::id gpt_sample_top_k_top_p_repeat(
// Audio utils
//

// Check if a buffer is a WAV audio file
bool is_wav_buffer(const std::string buf);

// Write PCM data into WAV audio file
class wav_writer {
private:
Expand Down
2 changes: 1 addition & 1 deletion scripts/sync-whisper.last
Original file line number Diff line number Diff line change
@@ -1 +1 @@
339a1cba5d4988e973190af8c814873fa3fb5c63
7d1400571779058ba2c2c2c0a9cb3a27ef7d828c