Hi Josh,

We went ahead to try to implement the function and are facing some issues
and your insight will be helpful.

1. We have implemented the function here:

 https://github.com/JHBalaji/media/blob/master/audio/src/param.rs#L419-L434
<https://github.com/JHBalaji/media/blob/master/audio/src/param.rs#L419-L434>.

 A)  Can you check if our implementation of interpolating between v[k] and
v[k+1] is correct? If not, can you give us a heads up as to how to
proceed?

The above code does give out a few errors as below:

   Compiling servo-media-audio v0.1.0 (/Users/akhilesh/Desktop/media/audio)

error[E0277]: cannot subtract `block::Tick` from `f32`

   --> audio/src/param.rs:432:37

    |

432 |                  *value = (y1 * (x2 - current_tick) + y2 *
(current_tick - x1)) / (x2 - x1) as f32;

    |                                     ^ no implementation for `f32 -
block::Tick`

    |

    = help: the trait `std::ops::Sub<block::Tick>` is not implemented for
`f32`


error[E0277]: cannot subtract `f32` from `block::Tick`

   --> audio/src/param.rs:432:74

    |

432 |                  *value = (y1 * (x2 - current_tick) + y2 *
(current_tick - x1)) / (x2 - x1) as f32;

    |
    ^ no implementation for `block::Tick - f32`

    |

    = help: the trait `std::ops::Sub<f32>` is not implemented for
`block::Tick`


error: aborting due to 2 previous errors

I was not able to subtract current_tick from the value instance I generated
to keep track of the expected time for v[k] and v[k+1]. Can you give me
some pointers as to how I can fix the same?

B) Should we declare the values vector and duration also somewhere else in
the program or are the changes made by me enough to handle the function?

2. There was one more modification I had to make to make the code compile
till the previous point. In L259
<https://github.com/JHBalaji/media/blob/master/audio/src/param.rs#L259> and
L271, if I also had the Copy trait called then it shows the error posted
below, which I believe is because of the values vector in the
SetValueCurveAtTime function. Can I just remove the copy trait or is there
any other modification that I have to make?

error[E0204]: the trait `Copy` may not be implemented for this type

   --> audio/src/param.rs:259:17

    |

259 | #[derive(Clone, Copy, PartialEq, Debug)]

    |                 ^^^^

...

266 |     SetValueCurveAtTime(Vec<f32>, Tick, /* duration */ f64),

    |                         -------- this field does not implement `Copy`


error[E0204]: the trait `Copy` may not be implemented for this type

   --> audio/src/param.rs:271:17

    |

271 | #[derive(Clone, Copy, PartialEq, Debug)]

    |                 ^^^^

...

278 |     SetValueCurveAtTime(Vec<f32>, f64, /* duration */ f64),

    |                         -------- this field does not implement `Copy`


error: aborting due to 2 previous errors


For more information about this error, try `rustc --explain E0204`.

error: Could not compile `servo-media-audio`.

This was apparently a problem for the group which worked with the
Oscillator node last semester and they weren't able to implement the custom
method
<https://github.com/servo/media/blob/master/audio/src/oscillator_node.rs#L150>
because they weren't able to solve this issue and when I spoke to one
person he said that removing the copy trait started showing up more errors
later. Can you give us your take on this?

Thanks
Akhilesh


On Thu, Mar 28, 2019 at 6:09 PM Josh Bowman-Matthews <j...@joshmatthews.net>
wrote:

> It looks like you're using WSL on Windows. This is not a supported
> configuration, unfortunately.
>
> Cheers,
> Josh
>
> On 3/28/19 6:05 PM, Josh Matthews wrote:
> > ---------- Forwarded message ---------
> > From: Srivatsan Narasimhan <snara...@ncsu.edu>
> > Date: Thu, 28 Mar 2019 at 18:00
> > Subject: Re: [dev-servo] println!("Hello from NCSU");
> > To: <j...@joshmatthews.net>
> >
> >
> > The contents of the image
> > sri@LAPTOP-L17CH6V2:/mnt/c/Users/sriva/OneDrive/Desktop/SEM-2/CSC 517
> > OODD/media-master/target/debug$ cargo build
> > warning: /mnt/c/Users/sriva/OneDrive/Desktop/SEM-2/CSC 517
> > OODD/media-master/Cargo.toml: unused manifest key: workspace.license
> >      Finished dev [unoptimized + debuginfo] target(s) in 0.50s
> > sri@LAPTOP-L17CH6V2:/mnt/c/Users/sriva/OneDrive/Desktop/SEM-2/CSC 517
> > OODD/media-master/target/debug$ ./constant_source
> > shared memfd open() failed: Function not implemented
> > shared memfd open() failed: Function not implemented
> > AL lib: (EE) ALCplaybackAlsa_open: Could not open playback device
> > 'default': No such file or directory
> >
> > On Thu, Mar 28, 2019 at 5:40 PM Srivatsan Narasimhan <snara...@ncsu.edu>
> > wrote:
> >
> >>
> >>
> >>
> >> Hi Josh,
> >> This is Srivatsan Narasimhan from NCSU currently working on the
> "Implement
> >> support for  missing WebAudio Automation " with my team mates Akhilesh
> and
> >> Balaji for the course CSC 517 OODD.
> >> I am currently having some problems in running an example. The build is
> >> successful but while running the constant_source file under target/debug
> >> folder, i get the following errors.
> >> Can you help me with this?
> >> [image: image.png]
> >> Thanks!
> >> Srivatsan Narasimhan
> >>
>
> _______________________________________________
> dev-servo mailing list
> dev-servo@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-servo
>
_______________________________________________
dev-servo mailing list
dev-servo@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-servo

Reply via email to