Basically a bottle that record when you speak through and play your sound when you open.
It seem that this might be a bit complicated if it only uses with arduino. So, I purpose the use of processing and arduino in combination.
Here is the picture of arduino
Left button is for recording and finish recording
Middle is for save
Right is for play the recorded message
Basically she could put a microphone at the bottom of the bottle and uses the wizard of oz technique to illustrate the experience (basically controlling it from behind)
So when the user start speaking, she press the left button. Once the user finish speaking she press the left button again to finish the recording then press the middle button to save.
Once someone pick the object up are unscrew the cap. She then press the right button the play the sound.
Arduino code
int recordButton = 0;
int saveButton = 0;
int playButton = 0;
void setup(){
Serial.begin(9600);
}
void loop(){
recordButton = digitalRead(10);
saveButton = digitalRead(3);
playButton = digitalRead(7);
if(recordButton == HIGH){
Serial.print(1);
delay(200);
}
if(saveButton == HIGH){
Serial.print(2);
delay(500);
}
if(playButton == HIGH){
Serial.print(3);
delay(200);
}
}
Processing code
import ddf.minim.*;
int beenrun = 0; // 0 = never run 1 = already run
Minim minim;
AudioInput in;
AudioRecorder recorder;
AudioPlayer player;
/*##########################*/
int countname; //change the name
int name = 000000; //set the number in key's' function
import processing.serial.*; // Load serial library
Serial myPort; // Set arduinoPort as serial connection
// change the file name
void newFile()
{
countname =( name + 1);
recorder = minim.createRecorder(in, "confession.wav", true);
// println("file/" + countname + ".wav");
}
void setup() {
size(512, 200, P2D);
textMode(SCREEN);
myPort = new Serial(this, Serial.list()[6], 9600); // Set arduino to 9600 baud
minim = new Minim(this);
println(Serial.list());
// get a stereo line-in: sample buffer length of 2048
// default sample rate is 44100, default bit depth is 16
in = minim.getLineIn(Minim.STEREO, 2048);
// create a recorder that will record from the input to the filename specified, using buffered recording
// buffered recording means that all captured audio will be written into a sample buffer
// then when save() is called, the contents of the buffer will actually be written to a file
// the file will be located in the sketch's root folder.
newFile();//go to change file name
textFont(createFont("SanSerif", 12));
}
void draw() {
background(200);
if ( recorder.isRecording() )
{
text("Currently recording...", 5, 15);
}
else
{
text("Not recording.", 5, 15);
}
int inByte = -1;
while (myPort.available () > 0) {
inByte = myPort.read();
if (inByte == 49){
if ( recorder.isRecording() )
{
recorder.endRecord();
}
else
{
/*#######################################*/
newFile();
/*#######################################*/
recorder.beginRecord();
}
}
if (inByte == 50){
recorder.save();
println("Done saving.");
println(name);//check the name
}
if (inByte == 51){
player = minim.loadFile("confession.wav", 2048);
println("Done saving.");
player.play();
}
}
}
void stop()
{
// always close Minim audio classes when you are done with them
in.close();
minim.stop();
super.stop();
}