File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change
1
+ mod test_support;
2
+ use std:: time:: Duration ;
3
+
4
+ use rodio:: Source ;
5
+ use test_support:: { TestSource , TestSpan } ;
6
+
7
+ #[ test]
8
+ fn without_buffered ( ) {
9
+ let source = TestSource :: new ( )
10
+ . with_span ( TestSpan :: silence ( ) . with_exact_duration ( Duration :: from_secs ( 5 ) ) ) ;
11
+
12
+ let reverb = source. clone ( ) . reverb ( Duration :: from_secs_f32 ( 0.05 ) , 0.3 ) ;
13
+ let n_samples = reverb. count ( ) ;
14
+
15
+ assert_eq ! ( n_samples, source. len( ) , ) ;
16
+ }
17
+
18
+ #[ test]
19
+ fn with_buffered ( ) {
20
+ let source = TestSource :: new ( )
21
+ . with_span ( TestSpan :: silence ( ) . with_exact_duration ( Duration :: from_secs ( 5 ) ) ) ;
22
+
23
+ let reverb = source. clone ( ) . buffered ( ) . reverb ( Duration :: from_secs_f32 ( 0.05 ) , 0.3 ) ;
24
+ let n_samples = reverb. count ( ) ;
25
+
26
+ assert_eq ! ( n_samples, source. len( ) , ) ;
27
+ }
You can’t perform that action at this time.
0 commit comments