zdsr_api/
zdsr_api.rs

1/*
2 * Copyright (c) 2024. The RigelA open source project team and
3 * its contributors reserve all rights.
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
9 * Unless required by applicable law or agreed to in writing, software distributed under the
10 * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 * See the License for the specific language governing permissions and limitations under the License.
12 */
13
14use zdsr_api::{init_tts, speak, get_speak_state, stop_speak};
15
16fn main() {
17    init_tts(0, std::ptr::null(), 0).unwrap();
18    speak([65,66,67].as_ptr(), 0).unwrap();
19    loop {
20        std::thread::sleep(std::time::Duration::from_millis(50));
21        if get_speak_state().unwrap() != 3 {
22            break
23        }
24    }
25    stop_speak().unwrap()
26}