Skip to content

Control of Volume for Memory Stream. How to do it? #1887

Answered by pschatzmann
dhionnystrauss asked this question in Q&A
Discussion options

You must be logged in to vote

The following is wrong if you want to use the VolumeStream. You copy the data directoy to i2s, so VolumeStream is not used.
For MemoryStream -> copy -> VolumeStream -> I2SStream you would need to replace:

 StreamCopy copierm(i2s, musicmanz); // copies sound into i2s

it needs to be

 StreamCopy copierm(volume, musicmanz); // copies sound into VolumeStream

This is using the VolumeStream on the output side of the copy.

You can also use it on the input side because this is PCM data to implement the following processing chain: MemoryStream -> VolumeStream -> copy -> I2SStream

 VolumeStream volume(musicmanz);
 StreamCopy copierm(i2s, volume); // copies volume to i2s

As you can see in the exam…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@dhionnystrauss
Comment options

Answer selected by pschatzmann
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants