Skip to content

Commit

Permalink
feat: make audio plugin public
Browse files Browse the repository at this point in the history
  • Loading branch information
mmpneo committed Jul 25, 2023
1 parent 2c018c2 commit b8d9241
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src-tauri/src/services/audio/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ fn get_output_stream(device_name: &str) -> Option<(OutputStream, OutputStreamHan

#[derive(Serialize, Deserialize, Debug)]
pub struct RpcAudioPlayAsync {
device_name: String,
data: Vec<u8>,
volume: f32, // 1 - base
rate: f32, // 1 - base
pub device_name: String,
pub data: Vec<u8>,
pub volume: f32, // 1 - base
pub rate: f32, // 1 - base
}

#[command]
async fn play_async(data: RpcAudioPlayAsync) -> Result<(), String> {
pub async fn play_async(data: RpcAudioPlayAsync) -> Result<(), String> {
if let Some((_stream, stream_handle)) = get_output_stream(data.device_name.as_str()) {
// let (_stream, stream_handle) = OutputStream::try_default().unwrap();
let sink = Sink::try_new(&stream_handle).unwrap();
Expand Down

0 comments on commit b8d9241

Please sign in to comment.