Show Posts
Pages: [1]
1  Topics / Interactive Art / Re: wave shield + 12 bit on: June 12, 2012, 12:16:09 am
ok, I'm sorry
the shield is the adafruits wave shield  http://www.adafruit.com/products/94
and this is my sketch


#include <AF_Wave.h>
#include <avr/pgmspace.h>
#include "util.h"
#include "wave.h"

int pirPin= 0;  // Reading from digital pin 11 PIR sensor!
int val = 0;

AF_Wave card;
File f;
Wavefile wave;

void setup() {
  // set up serial port
  Serial.begin(9600);
  pinMode(pirPin, INPUT);

  // set up waveshield pins
  pinMode(2, OUTPUT);
  pinMode(3, OUTPUT);
  pinMode(4, OUTPUT);
  pinMode(5, OUTPUT);
  pinMode(0, INPUT);
 
  // open memory card...........This part is necessary to set up and read SDcard!
 if (!card.init_card()) {
    putstring_nl("Card init. failed!"); return;
  }
  if (!card.open_partition()) {
    putstring_nl("No partition!"); return;
  }
  if (!card.open_filesys()) {
    putstring_nl("Couldn't open filesys"); return;
  }
  if (!card.open_rootdir()) {
    putstring_nl("Couldn't open dir"); return;
  }
 
  putstring_nl("Files fuond:");
  ls();
}

void ls() {
  char name[13];
  int ret;
 
  card.reset_dir();
  putstring_nl("Files found:");
  while (1) {
    ret = card.get_next_name_in_dir(name);
    if (!ret) {
       card.reset_dir();
       return;
    }
    Serial.println(name);
  }
}

void loop(){
val = analogRead(pirPin);
  Serial.println(val);
    if (val < 10) {
      Serial.println("e vai!");
       playcomplete("PEN3.WAV");
    }
    if (val > 11) {
      Serial.println ("zitto");
    }
    delay (500);
 // while (LOW==analogRead(pirPin)) {;}
        //  delay(5000);
}

 
void playcomplete(char *name){

  playfile(name);
  while (wave.isplaying);
  card.close_file(f);
}

void playfile(char *name) {
  // stop any file already playing
  if (wave.isplaying) {
    wave.stop();
    card.close_file(f);
  }

  f = card.open_file(name);
  if (f && wave.create(f)) {
    wave.play();
  }
}
 


but what mean this? : sample_12 = sample_16 >>4; 
thank you smiley
f
2  Topics / Interactive Art / wave shield + 12 bit on: June 11, 2012, 05:07:27 am
hi  smiley
I'm new in the arduino world
and I'm tried to build a simple project:
a voice activated from a sensor, when people are near the sensor the voice speak them..

I use a PIR sensor, an arduino 2009 and a wave shield (!!!)
is quiet simple and all system work good
the only problem is with the wave shield that want only 12 bit wav file
if you don't use a human voice with the shield this is not a big problem..because the sound is played.. but distort!  smiley-mad

and it seems impossible to convert file in this format,  smiley-cry
no one software make this conversion
I tried with many of this, from free to professional

Any one else have this problem?
help me
thank you
fraz
3  Topics / Interactive Art / Re: Seedstudio Music Shield + Proximity Sensor? on: June 11, 2012, 04:52:25 am
I have used a PIR..and it work good because I need play a voice I have to use a Wave shield ..that work only at 12 bit!!!!
12 bit is impossible, no one software convert wav in this format!!!
have you similar problem?
thanks
fr
Pages: [1]