File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -67,6 +67,22 @@ impl MixerDeviceSink {
6767 pub fn mixer ( & self ) -> & Mixer {
6868 & self . mixer
6969 }
70+ /// pause underlaying audio stream reducing cpu usage
71+ ///
72+ /// will silenty fail to play audio until play() is called
73+ ///
74+ /// This is an experimental API it is likely to removed once a better solution is found without notice or a change log entry
75+ #[ cfg( feature = "experimental" ) ]
76+ pub fn pause ( & self ) {
77+ let _ = self . _stream . pause ( ) ;
78+ }
79+ /// resume underlaying audio stream
80+ ///
81+ /// This is an experimental API it is likely to removed once a better solution is found without notice or a change log entry
82+ #[ cfg( feature = "experimental" ) ]
83+ pub fn play ( & self ) {
84+ let _ = self . _stream . play ( ) ;
85+ }
7086
7187 /// Access the sink's config.
7288 pub fn config ( & self ) -> & DeviceSinkConfig {
You can’t perform that action at this time.
0 commit comments