Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tuner's tests are failing on nightly #2

Open
Bujiraso opened this issue Jun 12, 2018 · 1 comment
Open

tuner's tests are failing on nightly #2

Bujiraso opened this issue Jun 12, 2018 · 1 comment
Labels
bug Something isn't working

Comments

@Bujiraso
Copy link

Bujiraso commented Jun 12, 2018

On nightly, a "cargo test" yields the following errors:

error[E0308]: mismatched types
   --> src/effects/tuner.rs:185:32
    |
185 |         let tuner = Tuner::new(sampling_rate, length);
    |                                ^^^^^^^^^^^^^ expected usize, found f32

error[E0599]: no method named `tune` found for type `effects::tuner::Tuner` in the current scope
   --> src/effects/tuner.rs:187:26
    |
12  | pub struct Tuner {
    | ---------------- method `tune` not found for this
...
187 |         let note = tuner.tune();
    |                          ^^^^

error: aborting due to 2 previous errors

The first one was easy to fix, as shown in the following patch:

---
 src/effects/tuner.rs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/effects/tuner.rs b/src/effects/tuner.rs
index 85994b1..45c1c05 100644
--- a/src/effects/tuner.rs
+++ b/src/effects/tuner.rs
@@ -182,7 +182,7 @@ mod tests {
                 ((2. * PI) * freq * t).sin() 
             }).collect();
 
-        let tuner = Tuner::new();
+        let tuner = Tuner::new(sampling_rate as usize, length);
         tuner.process_samples(&sin_vec, &mut vec![], &mut vec![]);
         let note = tuner.tune();
 
-- 
2.17.1

The second, I'm not sure if there is a "tuner.tune()" equivalent, anymore. It sems the tuner doesn't have the calculate_spectrum or tune functions, and then has no equivalent functtion that returns a simple note.

@Bujiraso
Copy link
Author

Might be easiest to delete the test, if it no longer applies, too.

@0b01 0b01 added enhancement New feature or request bug Something isn't working and removed enhancement New feature or request labels Jun 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants