You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: examples/async.rs
+46Lines changed: 46 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -16,6 +16,8 @@ use winrt::*;
16
16
use winrt::windows::foundation::*;
17
17
use winrt::windows::devices::enumeration::*;
18
18
use winrt::windows::devices::midi::*;
19
+
use winrt::windows::media::*;
20
+
use winrt::windows::storage::StorageFile;
19
21
20
22
fnmain(){
21
23
let rt = RuntimeContext::init();
@@ -78,4 +80,48 @@ async fn run() {
78
80
let device_name = current.get_name().unwrap();
79
81
println!("Device Name ({}): {}", i, device_name);
80
82
}
83
+
84
+
print!("Transcoding media: ");
85
+
let source = StorageFile::get_file_from_path_async(&*FastHString::new("D:\\Desktop\\test-transcode\\test.mp3")).unwrap().await.expect("get_file_from_path_async failed").unwrap();
86
+
let dest = StorageFile::get_file_from_path_async(&*FastHString::new("D:\\Desktop\\test-transcode\\test.flac")).unwrap().await.expect("get_file_from_path_async failed").unwrap();
87
+
let profile = mediaproperties::MediaEncodingProfile::create_flac(mediaproperties::AudioEncodingQuality::Medium).unwrap().unwrap();
88
+
let transcoder = transcoding::MediaTranscoder::new();
89
+
let prepared = transcoder.prepare_file_transcode_async(&source,&dest,&profile).unwrap().await.unwrap().unwrap();
0 commit comments