SttHandle -> Handle
This commit is contained in:
parent
d818a5fc82
commit
34754de586
1 changed files with 8 additions and 8 deletions
16
src/stt.zig
16
src/stt.zig
|
@ -1336,7 +1336,7 @@ pub fn init(allocator: std.mem.Allocator, options: Options) Error!Session {
|
||||||
/// C-compatible API functions for use from other languages
|
/// C-compatible API functions for use from other languages
|
||||||
/// These wrap the Zig API with C calling conventions
|
/// These wrap the Zig API with C calling conventions
|
||||||
/// Opaque handle type for C API
|
/// Opaque handle type for C API
|
||||||
pub const SttHandle = opaque {};
|
pub const Handle = opaque {};
|
||||||
|
|
||||||
/// Initialize STT library (C API)
|
/// Initialize STT library (C API)
|
||||||
///
|
///
|
||||||
|
@ -1345,9 +1345,9 @@ pub const SttHandle = opaque {};
|
||||||
/// - audio_device: Null-terminated ALSA device name
|
/// - audio_device: Null-terminated ALSA device name
|
||||||
///
|
///
|
||||||
/// Returns:
|
/// Returns:
|
||||||
/// - Pointer to SttHandle on success
|
/// - Pointer to Handle on success
|
||||||
/// - null on failure
|
/// - null on failure
|
||||||
pub export fn stt_init(model_path: [*:0]const u8, audio_device: [*:0]const u8) ?*SttHandle {
|
pub export fn stt_init(model_path: [*:0]const u8, audio_device: [*:0]const u8) ?*Handle {
|
||||||
// TODO: Implement C API wrapper in subsequent tasks
|
// TODO: Implement C API wrapper in subsequent tasks
|
||||||
_ = model_path;
|
_ = model_path;
|
||||||
_ = audio_device;
|
_ = audio_device;
|
||||||
|
@ -1356,7 +1356,7 @@ pub export fn stt_init(model_path: [*:0]const u8, audio_device: [*:0]const u8) ?
|
||||||
|
|
||||||
/// Set speech detection callback (C API)
|
/// Set speech detection callback (C API)
|
||||||
/// TODO: Implement in subsequent tasks with proper C-compatible callback types
|
/// TODO: Implement in subsequent tasks with proper C-compatible callback types
|
||||||
// pub export fn stt_set_speech_callback(handle: *SttHandle, callback: SpeechCallback, user_data: ?*anyopaque) void {
|
// pub export fn stt_set_speech_callback(handle: *Handle, callback: SpeechCallback, user_data: ?*anyopaque) void {
|
||||||
// _ = handle;
|
// _ = handle;
|
||||||
// _ = callback;
|
// _ = callback;
|
||||||
// _ = user_data;
|
// _ = user_data;
|
||||||
|
@ -1364,27 +1364,27 @@ pub export fn stt_init(model_path: [*:0]const u8, audio_device: [*:0]const u8) ?
|
||||||
|
|
||||||
/// Set error callback (C API)
|
/// Set error callback (C API)
|
||||||
/// TODO: Implement in subsequent tasks with proper C-compatible callback types
|
/// TODO: Implement in subsequent tasks with proper C-compatible callback types
|
||||||
// pub export fn stt_set_error_callback(handle: *SttHandle, callback: ErrorCallback, user_data: ?*anyopaque) void {
|
// pub export fn stt_set_error_callback(handle: *Handle, callback: ErrorCallback, user_data: ?*anyopaque) void {
|
||||||
// _ = handle;
|
// _ = handle;
|
||||||
// _ = callback;
|
// _ = callback;
|
||||||
// _ = user_data;
|
// _ = user_data;
|
||||||
// }
|
// }
|
||||||
|
|
||||||
/// Start listening (C API)
|
/// Start listening (C API)
|
||||||
pub export fn stt_start_listening(handle: *SttHandle) c_int {
|
pub export fn stt_start_listening(handle: *Handle) c_int {
|
||||||
_ = handle;
|
_ = handle;
|
||||||
// TODO: Implement in subsequent tasks
|
// TODO: Implement in subsequent tasks
|
||||||
return -1; // Error for now
|
return -1; // Error for now
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Stop listening (C API)
|
/// Stop listening (C API)
|
||||||
pub export fn stt_stop_listening(handle: *SttHandle) void {
|
pub export fn stt_stop_listening(handle: *Handle) void {
|
||||||
_ = handle;
|
_ = handle;
|
||||||
// TODO: Implement in subsequent tasks
|
// TODO: Implement in subsequent tasks
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Deinitialize STT library (C API)
|
/// Deinitialize STT library (C API)
|
||||||
pub export fn stt_deinit(handle: *SttHandle) void {
|
pub export fn stt_deinit(handle: *Handle) void {
|
||||||
_ = handle;
|
_ = handle;
|
||||||
// TODO: Implement in subsequent tasks
|
// TODO: Implement in subsequent tasks
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue