<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
      <title>Tagged with setvolume() - Processing 2.x and 3.x Forum</title>
      <link>https://forum.processing.org/two/discussions/tagged/feed.rss?Tag=setvolume%28%29</link>
      <pubDate>Sun, 08 Aug 2021 18:09:05 +0000</pubDate>
         <description>Tagged with setvolume() - Processing 2.x and 3.x Forum</description>
   <language>en-CA</language>
   <atom:link href="/two/discussions/taggedsetvolume%28%29/feed.rss" rel="self" type="application/rss+xml" />
   <item>
      <title>How to control sample volume in Minim</title>
      <link>https://forum.processing.org/two/discussion/4206/how-to-control-sample-volume-in-minim</link>
      <pubDate>Mon, 07 Apr 2014 18:56:51 +0000</pubDate>
      <dc:creator>GeorgeRoland</dc:creator>
      <guid isPermaLink="false">4206@/two/discussions</guid>
      <description><![CDATA[<p>I read in minim docs about a setVolume() function, but there are no examples. Further, the docs say, "if a volume control is not available, this (setVolume() ) does nothing.
I can't find any information on what is meant by "a volume control" being available or how to use the function.</p>

<p>Can you help?</p>

<p>Many thanks,</p>

<p>George</p>
]]></description>
   </item>
   <item>
      <title>How to customize button appearance or make button an image?</title>
      <link>https://forum.processing.org/two/discussion/24546/how-to-customize-button-appearance-or-make-button-an-image</link>
      <pubDate>Sat, 14 Oct 2017 16:44:49 +0000</pubDate>
      <dc:creator>Clova</dc:creator>
      <guid isPermaLink="false">24546@/two/discussions</guid>
      <description><![CDATA[<p>I need to to make an audio file play when clicking a button, such as in Dan Schiffman's example: 
var song;
var button;</p>

<p>function setup() {
  createCanvas(200, 200);
  song = loadSound("rainbow.mp3", loaded);
  button = createButton("play");
  button.mousePressed(togglePlaying);
  background(51);
}</p>

<p>function togglePlaying() {
  if (!song.isPlaying()) {
    song.play();
    song.setVolume(0.3);
    button.html("pause");
  } else {
    song.stop();
    button.html("play");
  }
}</p>

<p>function loaded() {
  console.log("loaded");
}</p>

<p>However, what if I wanted the button to be red instead of grey, or circular instead of rectangular, or larger? Or positioned somewhere specific? Or more preferably, how could I replace the button with an image that plays the song when clicked? 
I need multiple buttons, and I want them all to look different and play different audio files when clicked.</p>

<p>I've already seen examples where you can click ellipses to change the color or something, but I can't find or figure out how to make it work specifically for audio. I'm extremely new to p5.js and don't understand much of it.</p>

<p>Thank you</p>
]]></description>
   </item>
   <item>
      <title>Playing movie clips after after another at volume 0, there's sound for a split second every clip</title>
      <link>https://forum.processing.org/two/discussion/23102/playing-movie-clips-after-after-another-at-volume-0-there-s-sound-for-a-split-second-every-clip</link>
      <pubDate>Sat, 17 Jun 2017 17:19:39 +0000</pubDate>
      <dc:creator>krnkktz</dc:creator>
      <guid isPermaLink="false">23102@/two/discussions</guid>
      <description><![CDATA[<p>Hi,</p>

<p>i'm struggling to completely mute movie clips. Here's the code (I guess the problem lies in the new_movie() function at the bottom):</p>

<pre><code>import processing.video.*;

Movie movie;
String[] filenames;

void setup() {
  size(640, 480);
  java.io.File folder = new java.io.File(dataPath("C:\\Users\\Marin\\Downloads\\clips"));
  filenames = folder.list();
  frameRate(30);
  new_movie();
}

void draw() {
  if (movie.time() &gt;= movie.duration()) {
    new_movie();
  }

  if (movie.available()) {
    movie.read();
    background(0);
    image(movie, 0, 0);
  }
}

void new_movie() {
  int newmovid = int(random(filenames.length));
  movie = new Movie(this, "C:\\Users\\Marin\\Downloads\\clips\\" + filenames[newmovid]);
  movie.play();
  movie.volume(0);
}
</code></pre>

<p>Setting the volume before movie.play() has no effect (the whole clip plays at full volume) and removing the soundtrack from 1000+ mp4 files doesn't sound very optimal.</p>

<p>What should I do?</p>

<p>Thanks!</p>
]]></description>
   </item>
   <item>
      <title>trying to set the font, getting a black screen instead</title>
      <link>https://forum.processing.org/two/discussion/23410/trying-to-set-the-font-getting-a-black-screen-instead</link>
      <pubDate>Wed, 12 Jul 2017 03:54:56 +0000</pubDate>
      <dc:creator>mortebouse</dc:creator>
      <guid isPermaLink="false">23410@/two/discussions</guid>
      <description><![CDATA[<p>hello, i'm trying to code a short interactive animation in openprocessing with images, sound, and text, and when i try to use textFont() in preload(), my whole sketch goes black (though the interactivity and sound both remain). and if i try to use it in draw() or setup(), it sets itself to a different font instead and sets the font size to the same size across the sketch.</p>

<p>the only time it has worked when i tried (but not with the typeface i need) it is when i set it to textFont('Courier') in draw(). i've tried to load another .ttf file to see if the font itself was the problem, but the replacement one didn't work either. the font i'm trying to load is <a rel="nofollow" href="https://fontstruct.com/fontstructions/show/675134/fontstuck_2">this one</a>.</p>

<p>you can find my sketch <a rel="nofollow" href="https://www.openprocessing.org/sketch/438767">here</a>. it takes a little bit of time to load. i would post the code here, too but there are a dozen files needed to play it locally, so i think it's better if i don't. if you need more information, let me know.</p>

<p>thanks in advance.</p>
]]></description>
   </item>
   <item>
      <title>Minim setGain/probably my fault</title>
      <link>https://forum.processing.org/two/discussion/20425/minim-setgain-probably-my-fault</link>
      <pubDate>Mon, 23 Jan 2017 11:29:27 +0000</pubDate>
      <dc:creator>latto_bitra</dc:creator>
      <guid isPermaLink="false">20425@/two/discussions</guid>
      <description><![CDATA[<p>Hello guys!! I'm new to this forum :) !! And I'm new to processing in general.....and in this code I have a problem with minim "setGain()". 
I'm trying to triggering a piano note every time the play bar is hitting a rectangle with "setGain(0) and play(0)" (the length of rectangles represent the duration of the piano note duration) and muting/stopping the sound when the play bar is hitting the end of a rectangle with "setGain(-200)" (I've tried also with "setVolume()").</p>

<p>The problem is: there are two rectangles for now and both duration always refer to the length of the first rectangle(when "setGain(-200)") , the second sound (combined with the second rectangle) is not happening at all, or, it happing with the length of the first rectangle :((</p>

<p>Is there anybody who can help me  8-|  ? Where am I doing wrong  :-?  ?</p>

<p>p.s. the rectangle are created randomly so you have to click every time on "play" to make a different combination between the two rectangles.</p>

<pre><code>import ddf.minim.*;
Minim minim;
AudioPlayer piano_C3;
AudioPlayer piano_Cdiesis3;
AudioPlayer piano_D3;
AudioPlayer piano_Ddiesis3;
AudioPlayer piano_E3;
AudioPlayer piano_F3;
AudioPlayer piano_Fdiesis3;
AudioPlayer piano_G3;
AudioPlayer piano_Gdiesis3;
AudioPlayer piano_A3;
AudioPlayer piano_Adiesis3;
AudioPlayer piano_B3;
AudioPlayer piano_C4;

float menusp;
float noteX1;
float noteX2;
float noteY1;
float noteY2;
int noteAlpha1;
int noteAlpha2;
int sceltoX1;
int sceltoX2;
int sceltoY1;
int sceltoY2;
int sceltoAlpha1;
int sceltoAlpha2;
float movelineX;
float Ktempo;
float PX1I;
float PX2I;
float fixedNoteY;
float lenght1;
float lenght2;
float lenghtTot;



void setup () {

  size (450, 750);
  rectMode (CENTER);
  minim=new Minim (this);
  piano_C3=minim.loadFile ("C3.mp3");  
  piano_Cdiesis3=minim.loadFile ("Cdiesis3.mp3");
  piano_D3=minim.loadFile ("D3.mp3");
  piano_Ddiesis3=minim.loadFile ("Ddiesis3.mp3");
  piano_E3=minim.loadFile ("E3.mp3");
  piano_F3=minim.loadFile ("F3.mp3");
  piano_Fdiesis3=minim.loadFile ("Fdiesis3.mp3");
  piano_G3=minim.loadFile ("G3.mp3");
  piano_Gdiesis3=minim.loadFile ("Gdiesis3.mp3");
  piano_A3=minim.loadFile ("A3.mp3");
  piano_Adiesis3=minim.loadFile ("Adiesis3.mp3");
  piano_B3=minim.loadFile ("B3.mp3");
  piano_C4=minim.loadFile ("C4.mp3");

  menusp=height-(height/4);  
  fixedNoteY=menusp/12; 
  float[] dataY1={(height-fixedNoteY), (height-(fixedNoteY*2)), 
    (height-(fixedNoteY*3)), (height-(fixedNoteY*4)), 
    (height-(fixedNoteY*5)), (height-(fixedNoteY*6)), 
    (height-(fixedNoteY*7)), (height-(fixedNoteY*8)), 
    (height-(fixedNoteY*9)), (height-(fixedNoteY*10)), 
    (height-(fixedNoteY*11)), (height-(fixedNoteY*12))}; 
  sceltoY1=int(random(dataY1.length));
  noteY1=(dataY1 [sceltoY1]);



  float[] dataY2={(height-fixedNoteY), (height-(fixedNoteY*2)), 
    (height-(fixedNoteY*3)), (height-(fixedNoteY*4)), 
    (height-(fixedNoteY*5)), (height-(fixedNoteY*6)), 
    (height-(fixedNoteY*7)), (height-(fixedNoteY*8)), 
    (height-(fixedNoteY*9)), (height-(fixedNoteY*10)), 
    (height-(fixedNoteY*11)), (height-(fixedNoteY*12))}; 
  sceltoY2=int(random(dataY2.length));
  noteY2=(dataY2 [sceltoY2]);



  int[] dataX1={4, 8, 16};
  sceltoX1=int(random(dataX1.length));
  noteX1=(dataX1 [sceltoX1]);

  int[] dataX2={4, 8, 16}; 
  sceltoX2=int(random(dataX2.length));
  noteX2=(dataX2 [sceltoX2]);


  int[] alpha1 ={255, 0, 255, 0};
  sceltoAlpha1=int(random(alpha1.length));                 
  noteAlpha1=(alpha1[sceltoAlpha1]);

  int[] alpha2 ={255, 0, 255, 0};
  sceltoAlpha2=int(random(alpha2.length));                 
  noteAlpha2=(alpha2[sceltoAlpha2]);

  lenght1=width/noteX1;
  PX1I=0;
  lenght2=(width/noteX2);
  PX2I=(width/16);
}


void draw () {


  background (255);

  //triggering note 1

  if (movelineX==PX1I &amp;&amp; noteY1==(height-fixedNoteY) &amp;&amp; noteAlpha1!=0 ) {     //C3 
    piano_C3.setGain(0);
    piano_C3.play(0);
  }  
  if (movelineX&gt;lenght1) {                                                         
    piano_C3.setGain(-200);
  } else { 
    piano_C3.setGain(0);
  }
  if (movelineX==PX1I &amp;&amp; noteY1==(height-(2*fixedNoteY)) &amp;&amp; noteAlpha1!=0 ) {  //Cdiesis3  
    piano_Cdiesis3.setGain(0);
    piano_Cdiesis3.play(0);
  }  
  if (movelineX&gt;lenght1) {                                                         
    piano_Cdiesis3.setGain(-200);
  } else { 
    piano_Cdiesis3.setGain(0);
  }
  if (movelineX==PX1I &amp;&amp; noteY1==(height-(3*fixedNoteY)) &amp;&amp; noteAlpha1!=0 ) {  //D3  
    piano_D3.setGain(0);
    piano_D3.play(0);
  }  
  if (movelineX&gt;lenght1) {                                                         
    piano_D3.setGain(-200);
  } else { 
    piano_D3.setGain(0);
  }
  if (movelineX==PX1I &amp;&amp; noteY1==(height-(4*fixedNoteY)) &amp;&amp; noteAlpha1!=0 ) {  //Ddiesis3    
    piano_Ddiesis3.setGain(0);
    piano_Ddiesis3.play(0);
  }
  if (movelineX&gt;lenght1) {                                                         
    piano_Ddiesis3.setGain(-200);
  } else { 
    piano_Ddiesis3.setGain(0);
  }
  if (movelineX==PX1I &amp;&amp; noteY1==(height-(5*fixedNoteY)) &amp;&amp; noteAlpha1!=0 ) {  //E3 
    piano_E3.setGain(0);
    piano_E3.play(0);
  }
  if (movelineX&gt;lenght1) {                                                         
    piano_E3.setGain(-200);
  } else { 
    piano_E3.setGain(0);
  }
  if (movelineX==PX1I &amp;&amp; noteY1==(height-(6*fixedNoteY)) &amp;&amp; noteAlpha1!=0 ) {  //F3  
    piano_F3.setGain(0);
    piano_F3.play(0);
  }  
  if (movelineX&gt;lenght1) {                                                         
    piano_F3.setGain(-200);
  } else { 
    piano_F3.setGain(0);
  }
  if (movelineX==PX1I &amp;&amp; noteY1==(height-(7*fixedNoteY)) &amp;&amp; noteAlpha1!=0 ) {  //Fdiesis3 
    piano_Fdiesis3.setGain(0);
    piano_Fdiesis3.play(0);
  }  
  if (movelineX&gt;lenght1) {                                                         
    piano_Fdiesis3.setGain(-200);
  } else { 
    piano_Fdiesis3.setGain(0);
  }
  if (movelineX==PX1I &amp;&amp; noteY1==(height-(8*fixedNoteY)) &amp;&amp; noteAlpha1!=0 ) {  //G3  
    piano_G3.setGain(0);
    piano_G3.play(0);
  }  
  if (movelineX&gt;lenght1) {                                                         
    piano_G3.setGain(-200);
  } else { 
    piano_G3.setGain(0);
  }
  if (movelineX==PX1I &amp;&amp; noteY1==(height-(9*fixedNoteY)) &amp;&amp; noteAlpha1!=0 ) {  //Gdiesis3
    piano_Gdiesis3.setGain(0);
    piano_Gdiesis3.play(0);
  }  
  if (movelineX&gt;lenght1) {                                                         
    piano_Gdiesis3.setGain(-200);
  } else { 
    piano_Gdiesis3.setGain(0);
  }
  if (movelineX==PX1I &amp;&amp; noteY1==(height-(10*fixedNoteY)) &amp;&amp; noteAlpha1!=0 ) {  //A3    
    piano_A3.setGain(0);
    piano_A3.play(0);
  }  
  if (movelineX&gt;lenght1) {                                                         
    piano_A3.setGain(-200);
  } else { 
    piano_A3.setGain(0);
  }
  if (movelineX==PX1I &amp;&amp; noteY1==(height-(11*fixedNoteY)) &amp;&amp; noteAlpha1!=0 ) {  //Adiesis3  
    piano_Adiesis3.setGain(0);
    piano_Adiesis3.play(0);
  }  
  if (movelineX&gt;lenght1) {                                                         
    piano_Adiesis3.setGain(-200);
  } else { 
    piano_Adiesis3.setGain(0);
  }
  if (movelineX==PX1I &amp;&amp; noteY1==(height-(12*fixedNoteY)) &amp;&amp; noteAlpha1!=0 ) {  //B3 
    piano_B3.setGain(0);
    piano_B3.play(0);
  }  
  if (movelineX&gt;lenght1) {                                                         
    piano_B3.setGain(-200);
  } else { 
    piano_B3.setGain(0);
  }
  if (movelineX==PX1I &amp;&amp; noteY1==(height-(13*fixedNoteY)) &amp;&amp; noteAlpha1!=0 ) {  //C4 
    piano_C4.setGain(0);
    piano_C4.play(0);
  }  
  if (movelineX&gt;lenght1) {                                                         
    piano_C4.setGain(-200);
  } else { 
    piano_C4.setGain(0);
  }


  //triggering note2

  if (movelineX==PX2I &amp;&amp; noteY2==(height-fixedNoteY) &amp;&amp; noteAlpha2!=0 ) {   //C3 
    piano_C3.setGain(0);
    piano_C3.play(0);
  }  
  if (movelineX&gt;(lenght1+lenght2)) {                                                         
    piano_C3.setGain(-100);
  } 
  if (movelineX==PX2I &amp;&amp; noteY2==(height-(2*fixedNoteY)) &amp;&amp; noteAlpha2!=0 ) {   //Cdiesis3
    piano_Cdiesis3.setGain(0);
    piano_Cdiesis3.play(0);
  }  
  if (movelineX&gt;(lenght1+lenght2)) {                                                         
    piano_Cdiesis3.setGain(-100);
  } 
  if (movelineX==PX2I &amp;&amp; noteY2==(height-(3*fixedNoteY)) &amp;&amp; noteAlpha2!=0 ) {   //D3 
    piano_D3.setGain(0);
    piano_D3.play(0);
  }  
  if (movelineX&gt;(lenght1+lenght2)) {                                                         
    piano_D3.setGain(-100);
  }
  if (movelineX==PX2I &amp;&amp; noteY2==(height-(4*fixedNoteY)) &amp;&amp; noteAlpha2!=0 ) {   //Ddiesis3  
    piano_Ddiesis3.setGain(0);
    piano_Ddiesis3.play(0);
  }  
  if (movelineX&gt;(lenght1+lenght2)) {                                                         
    piano_Ddiesis3.setGain(-100);
  }
  if (movelineX==PX2I &amp;&amp; noteY2==(height-(5*fixedNoteY)) &amp;&amp; noteAlpha2!=0 ) {   //E3
    piano_E3.setGain(0);
    piano_E3.play(0);
  }  
  if (movelineX&gt;(lenght1+lenght2)) {                                                         
    piano_E3.setGain(-100);
  }
  if (movelineX==PX2I &amp;&amp; noteY2==(height-(6*fixedNoteY)) &amp;&amp; noteAlpha2!=0 ) {   //F3  
    piano_F3.setGain(0);
    piano_F3.play(0);
  }  
  if (movelineX&gt;(lenght1+lenght2)) {                                                         
    piano_F3.setGain(-100);
  }
  if (movelineX==PX2I &amp;&amp; noteY2==(height-(7*fixedNoteY)) &amp;&amp; noteAlpha2!=0 ) {   //Fdiesis3
    piano_Fdiesis3.setGain(0);
    piano_Fdiesis3.play(0);
  }  
  if (movelineX&gt;(lenght1+lenght2)) {                                                         
    piano_Fdiesis3.setGain(-100);
  }
  if (movelineX==PX2I &amp;&amp; noteY2==(height-(8*fixedNoteY)) &amp;&amp; noteAlpha2!=0 ) {   //G3 
    piano_G3.setGain(0);
    piano_G3.play(0);
  }  
  if (movelineX&gt;(lenght1+lenght2)) {                                                         
    piano_G3.setGain(-100);
  }
  if (movelineX==PX2I &amp;&amp; noteY2==(height-(9*fixedNoteY)) &amp;&amp; noteAlpha2!=0 ) {   //Gdiesis3  
    piano_Gdiesis3.setGain(0);
    piano_Gdiesis3.play(0);
  }  
  if (movelineX&gt;(lenght1+lenght2)) {                                                         
    piano_Gdiesis3.setGain(-100);
  }
  if (movelineX==PX2I &amp;&amp; noteY2==(height-(10*fixedNoteY)) &amp;&amp; noteAlpha2!=0 ) {   //A3   
    piano_A3.setGain(0);
    piano_A3.play(0);
  }  
  if (movelineX&gt;(lenght1+lenght2)) {                                                         
    piano_A3.setGain(-100);
  }
  if (movelineX==PX2I &amp;&amp; noteY2==(height-(11*fixedNoteY)) &amp;&amp; noteAlpha2!=0 ) {   //Adiesis3
    piano_Adiesis3.setGain(0);
    piano_Adiesis3.play(0);
  }  
  if (movelineX&gt;(lenght1+lenght2)) {                                                         
    piano_Adiesis3.setGain(-100);
  }
  if (movelineX==PX2I &amp;&amp; noteY2==(height-(12*fixedNoteY)) &amp;&amp; noteAlpha2!=0 ) {   //B3
    piano_B3.setGain(0);
    piano_B3.play(0);
  }  
  if (movelineX&gt;(lenght1+lenght2)) {                                                         
    piano_B3.setGain(-100);
  }
  if (movelineX==PX2I &amp;&amp; noteY2==(height-(13*fixedNoteY)) &amp;&amp; noteAlpha2!=0 ) {   //C4   
    piano_C4.setGain(0);
    piano_C4.play(0);
  }  
  if (movelineX&gt;(lenght1+lenght2)) {                                                         
    piano_C4.setGain(-100);
  }


  // orizontal lines
  stroke (1); 
  strokeWeight (1);
  for (float ia = 0; ia &lt; 750; ia = ia+(menusp/12)) {
    line (0, ia, 450, ia);
  }


  // vertical lines
  for (float ib = 0; ib &lt; 450; ib = ib+(width/16)) {
    line (ib, 0, ib, 750);
  }




  //note 1
  fill (24, 0, 191, noteAlpha1);
  if (noteAlpha1==0) {
    stroke (0, 0, 0, 0);
  } else {
    stroke (1);
  }

  rectMode (CORNER); // modalità corner rect (x1,y1,x2,y2)
  rect (PX1I, noteY1, lenght1, fixedNoteY);   
  rectMode (CENTER); // ritorna la modalità centro

  //note 2
  fill (255, 0, 1, noteAlpha2);
  if (noteAlpha2==0) {
    stroke (0, 0, 0, 0);
  } else {
    stroke (1);
  }

  rectMode (CORNER);
  rect (PX2I, noteY2, lenght2, fixedNoteY);   
  rectMode (CENTER); // ritorna la modalità centro





  // play bar
  strokeWeight (5); 
  stroke (#FF05DE);
  Ktempo=1;
  movelineX=movelineX+Ktempo;
  if (movelineX&gt;=width) {
    movelineX=0;
    piano_C3.setGain(0);
    piano_Cdiesis3.setGain(0);
    piano_D3.setGain(0);
    piano_Ddiesis3.setGain(0);
    piano_E3.setGain(0);
    piano_F3.setGain(0);
    piano_Fdiesis3.setGain(0);
    piano_G3.setGain(0);
    piano_Gdiesis3.setGain(0);
    piano_A3.setGain(0);
    piano_Adiesis3.setGain(0);
    piano_B3.setGain(0);
    piano_C4.setGain(0);
  }

  line(0+movelineX, 0, 0+movelineX, height);
  strokeWeight (1);


  stroke (1); 
  strokeWeight (1);
  noStroke ();
  fill (0, 220, 141);
  rect (width/2, (height/8), width, ((height/4)+2));
}
</code></pre>
]]></description>
   </item>
   <item>
      <title>Sounds elemnts works so slow on mobile.</title>
      <link>https://forum.processing.org/two/discussion/14984/sounds-elemnts-works-so-slow-on-mobile</link>
      <pubDate>Thu, 18 Feb 2016 05:44:22 +0000</pubDate>
      <dc:creator>Jiun</dc:creator>
      <guid isPermaLink="false">14984@/two/discussions</guid>
      <description><![CDATA[<p><a href="http://codeartress.tistory.com/7" target="_blank" rel="nofollow">http://codeartress.tistory.com/7</a></p>

<p>I work this with p5js sound elements.
When I open this url on web ,  the speed is quite ok but on mobile looks like so slow.</p>

<p>Do you know the reason?</p>
]]></description>
   </item>
   <item>
      <title>How do I do to increase or decrease the volume of a music/sound  ?</title>
      <link>https://forum.processing.org/two/discussion/8155/how-do-i-do-to-increase-or-decrease-the-volume-of-a-music-sound</link>
      <pubDate>Fri, 14 Nov 2014 15:35:51 +0000</pubDate>
      <dc:creator>andredamasio</dc:creator>
      <guid isPermaLink="false">8155@/two/discussions</guid>
      <description><![CDATA[<p>I want to do a program that reads the position of the mouse and if the mouse is near a object the volume of a sound become Higher and if the mouse is far from a object the volume become lower.</p>

<p>I already know how to put a sound in processing using the Minim library. But i don't know how to change the volume value.</p>

<p>Can you help me?</p>
]]></description>
   </item>
   <item>
      <title>How to set volume in minim?</title>
      <link>https://forum.processing.org/two/discussion/7237/how-to-set-volume-in-minim</link>
      <pubDate>Fri, 19 Sep 2014 12:15:56 +0000</pubDate>
      <dc:creator>cklkaren</dc:creator>
      <guid isPermaLink="false">7237@/two/discussions</guid>
      <description><![CDATA[<p>Hello, I am trying to loop a song where when the audio input is at certain level, the volume of the song would be lowered; and when it is retrieved back to normal volume of audio input, the song will continue to play.
What I am trying to do now is to mute and unmute the song, but it doesn't seem working...</p>

<pre><code>import ddf.minim.*;

Minim       minim;
AudioInput  in;
AudioPlayer song;

void setup()
{
  size(512, 200);

  minim = new Minim(this);
  in = minim.getLineIn();
  song = minim.loadFile("song.mp3", 1024);
}

void draw()
{
  background(0);
  stroke(255);

  //draw sound line
  for(int i = 0; i &lt; in.bufferSize() - 1; i++){
    line( i, height/7 + in.left.get(i)*height/7, 
          i+1, height/7 + in.left.get(i+1)*height/7 );
    line( i, height*6/7 + in.right.get(i)*height/7, 
          i+1, height*6/7 + in.right.get(i+1)*height/7 );
  }

  if (in.left.level()&gt;0.5){
    song.mute();
  } else {   
    song.play();
  }

  println(in.left.level());
}
</code></pre>

<p>Within the if function, I have tried using boolean and song.pause(); and the same issue happened that the whole song would stop playing and wouldn't replay again. I also tried setVolume(); where it said volume is not supported. Hence, I came up with an idea to set the volume to mute and play. But it's still not working...</p>
]]></description>
   </item>
   </channel>
</rss>