Giter Site home page Giter Site logo

playfultechnology / audio-guestbook Goto Github PK

View Code? Open in Web Editor NEW
123.0 17.0 79.0 5.18 MB

The "audio guestbook" is a converted telephone handset that guests can use to leave recorded messages at weddings and parties

License: GNU General Public License v3.0

C++ 100.00%

audio-guestbook's Introduction

audio-guestbook

The audio guestbook is a converted telephone handset that guests can use to leave recorded messages at weddings, parties and other events, as sold by companies such as "After the Tone", "Fête Fone", "Life on Record", "At the Beep", and others.

Watch the full step-by-step tutorial on how to use the code here to build your own at https://youtu.be/dI6ielrP1SE


Disabled MTP during recording

In some cases, the MTP capability (allowing file transfer without removing the SD card) seems to interfere with recording. MTP medium-change checking is thus disabled during recording. A suitable message is sent to the serial monitor so you can see when it's been enabled.

Audio tweaks

Background

The "modifications by h4yn0nnym0u5e, October 27th 2022" work significantly better if the audio library is "tweaked" to use larger data blocks and thus less-frequent audio updates. This allows more time for an SD card write before an interrupt is missed and audio data are lost.

Installation method

Unfortunately, "installation" is a bit messy, but you only have to do it once (unless you update your Arduino IDE or Teensyduino). The guestbook sketch folder contains two Arduino architecture configuration files, boards.local.txt andplatform.txt. These must be used to update your existing configuration files; in Windows systems these will typically be in C:\Program Files (x86)\Arduino\hardware\teensy\avr [todo: where are they on Linux and Mac?].

Before you do anything else, back up the existing configuration files! Then, make sure all running copies of the Arduino IDE are closed.

The content of boards.local.txt should be merged with the existing file; if you don't have one, just copy this file in.

You can either replace the existing platform.txt with the new one, or if the existing one looks very different, try to edit it to include all four references to build.flags.audio, in similar locations to those found in the replacement file.

Once the configuration files have been amended, run the Arduino IDE and look at the Tools menu. All being well, you will see a new "Audio tweaks" setting available, with options Normal and Bigger blocks (256 samples).

In use

Open the audio guestbook sketch, ensure you have the correct Teensy options set, and set "Audio tweaks" to the Bigger blocks (256 samples) option. Upload as usual, and check that there's a message on the Serial console which says "Audio block set to 256 samples". If this is present, the tweaks installation is successful, and you should find your audio recordings less prone to glitches and dropouts. You should still use a decent SD card, and format it "properly" - there's plenty of guidance in the Teensy forum.

For most audio projects, leave Audio tweaks set to Normal, as the audio library isn't fully tested with 256-sample blocks.

DO NOT copy the play_wav_sd.cpp and .h files to your Audio library: They should appear as extra tabs in your Arduino IDE, but are only of use for this project and will break other audio applications using SD playback!

Technical stuff

Tweaks

As noted above, the tweaks work by increasing the number of audio samples in an "audio block" from 128 to 256. This means that audio updates run every 5.8ms rather than the standard 2.9ms, with the consequence that an SD write can take nearly 12ms before an update is "lost". It would be better to figure out how to prevent the SD card write from masking interrupts, but I'm clearly not quite smart enough...

The audio library AudioPlaySdWav object is unfortunately one of those that doesn't work well with anything other than a standard 128-sample audio block. Therefore, a (renamed) copy which does work properly is now included within the sketch folder, and used instead of the stock object.

Instrumented SD writes

You can monitor the time taken for SD card writes by defining the symbol INSTRUMENT_SD_WRITE. This is disabled by default, but a line ready for easy editing can be found near the top of the main sketch file. Ideally writes should take significantly less than 6000µs without audio tweaks, or 12000µs with them. Worst-case write times are output every 0.25s.


Modifications by h4yn0nnym0u5e, October 27th-30th 2022:

  • modifications to improve recording reliability:
    • write in larger chunks
    • use bigger audio blocks to increase update period
    • disable MTP medium change checks during recording
  • corrected WAV header writes to make chunk lengths correct
  • optional code to determine SD card write time

Modifications by DD4WH, August 1st, 2022:

  • recordings are now saved as WAV files
  • recordings on the SD card can be accessed via USB, no more need to take out the SD card
  • code modifications for a telephone with closing contact as the handheld is being lifted
  • playback only plays the very last recorded file, not ALL the files ever recorded
  • does not play the greeting message again when you want to listen to your recordings
  • some bugfixes and warnings eliminated
  • do not forget that your greeting message has to be recorded as a WAV with a sample rate of 44.1ksps, otherwise it is not played
  • compile the code with CPU speed 150MHz, this can save a lot of battery power (reduction by about 70%)

DD4WH hardware:

  • telephone model "POST FeTAp 611-2a", built about 1972
  • Teensy 4.0
  • Audio Board for Teensy 4
  • AOM5024 electret low noise microphone capsule (the original mic capsule was thrown away)
  • push button with red knob
  • microUSB to USB-A cable
  • shielded microphone cable

audio-guestbook's People

Contributors

alastaira avatar dd4wh avatar h4yn0nnym0u5e avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

audio-guestbook's Issues

MTP not declared in scope

Hello! Thank you so much for developing this awesome package.

I'm trying to run this on the Teensy 4.1, and am having trouble with the MTP part of it. I have moved the MTP_Teensy src code into the Teensyduino library. I had to edit some parts of the MTP_Teensy.h, most notably //#ifndef MTP_TEENSY_H, #define USB_MTPDISK_SERIAL, and defining the variables #define MTP_*_SIZE_480.

After doing all of this, I am now getting the error below and do not know how to fix it. I would appreciate some advice!

/Users/amandapagul/Software/audio-guestbook/audio-guestbook.ino: In function 'void setup()':
/Users/amandapagul/Software/audio-guestbook/audio-guestbook.ino:133:5: error: 'MTP' was not declared in this scope
     MTP.begin();
     ^
/Users/amandapagul/Software/audio-guestbook/audio-guestbook.ino: In function 'void loop()':
/Users/amandapagul/Software/audio-guestbook/audio-guestbook.ino:229:3: error: 'MTP' was not declared in this scope
   MTP.loop();  //This is mandatory to be placed in the loop code.
   ^
Error compiling for board Teensy 4.1.


This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

How to Power via a power bank

This could be a dumb question, but this is my first full DIY electronic project. I need clarification about the power bank situation. Should I be powering the phone directly? Or simply powering the Teensy board via the micro USB connection?

I'm currently powering the Teensy board with a power bank directly through the micro USB port. However, I'm getting no sound out of the speaker and no sound into the microphone. The serial monitor states everything is in working order, and I think the problem is that there is a lack of power being distributed to the phone's internal components. Any clarification here would be appreciated.

Unable to load to teensy...help

Multiple error codes, im using the copied code

C:\Users\crazy\AppData\Local\Temp\arduino_build_1380\libraries\MTP_Teensy-main\MTP_Storage.cpp.o: In function mtp_yield()': C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\MTP_Teensy-main\src/MTP_Storage.cpp:315: multiple definition of mtp_yield()'
C:\Users\crazy\AppData\Local\Temp\arduino_build_1380\libraries\SD\Storage.cpp.o:C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\SD\src/Storage.cpp:73: first defined here
c:/program files (x86)/arduino/hardware/tools/arm/bin/../lib/gcc/arm-none-eabi/5.4.1/../../../../arm-none-eabi/bin/ld.exe: Disabling relaxation: it will not work with multiple definitions
C:\Users\crazy\AppData\Local\Temp\arduino_build_1380\libraries\MTP_Teensy-main\MTP_Storage.cpp.o: In function Print::flush()': C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4/FS.h:158: multiple definition of mtp_lock_storage(bool)'
C:\Users\crazy\AppData\Local\Temp\arduino_build_1380\libraries\SD\Storage.cpp.o:C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4/FS.h:158: first defined here
C:\Users\crazy\AppData\Local\Temp\arduino_build_1380\libraries\MTP_Teensy-main\MTP_Teensy.cpp.o: In function usb_init_events': C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\MTP_Teensy-main\src/MTP_Teensy.cpp:1722: multiple definition of usb_init_events'
C:\Users\crazy\AppData\Local\Temp\arduino_build_1380\libraries\SD\MTP.cpp.o:C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\SD\src/MTP.cpp:1434: first defined here
C:\Users\crazy\AppData\Local\Temp\arduino_build_1380\libraries\MTP_Teensy-main\MTP_Teensy.cpp.o: In function FS::format(int, char, Print&)': C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\MTP_Teensy-main\src/MTP_Teensy.cpp:1436: multiple definition of usb_mtp_recvEvent'
C:\Users\crazy\AppData\Local\Temp\arduino_build_1380\libraries\SD\MTP.cpp.o:C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\SD\src/Storage.h:183: first defined here
C:\Users\crazy\AppData\Local\Temp\arduino_build_1380\libraries\MTP_Teensy-main\MTP_Teensy.cpp.o: In function FS::format(int, char, Print&)': C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\MTP_Teensy-main\src/MTP_Teensy.cpp:1436: multiple definition of usb_mtp_sendEvent'
C:\Users\crazy\AppData\Local\Temp\arduino_build_1380\libraries\SD\MTP.cpp.o:C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\SD\src/Storage.h:183: first defined here
collect2.exe: error: ld returned 1 exit status

Help me with 'AudioPlaySdWavX" error

I have no coding experience, but I'm trying to work through the errors that come up. Now I have this one:

"Arduino: 1.8.19 (Windows 10), TD: 1.57, Board: "Teensy 4.0, Serial + MTP Disk (Experimental), 600 MHz, Faster, US English"

C:\Users\thebe\AppData\Local\Temp\Temp3_audio-guestbook-main.zip\audio-guestbook-main\audio-guestbook\audio-guestbook.ino:49:1: error: 'AudioPlaySdWavX' does not name a type

AudioPlaySdWavX playWav1; // Play 44.1kHz 16-bit PCM greeting WAV file

^

C:\Users\thebe\AppData\Local\Temp\Temp3_audio-guestbook-main.zip\audio-guestbook-main\audio-guestbook\audio-guestbook.ino:54:28: error: 'playWav1' was not declared in this scope

AudioConnection patchCord3(playWav1, 0, mixer, 1); // wav file playback mixer

                        ^

C:\Users\thebe\AppData\Local\Temp\Temp3_audio-guestbook-main.zip\audio-guestbook-main\audio-guestbook\audio-guestbook.ino: In function 'void loop()':

C:\Users\thebe\AppData\Local\Temp\Temp3_audio-guestbook-main.zip\audio-guestbook-main\audio-guestbook\audio-guestbook.ino:185:7: error: 'playWav1' was not declared in this scope

   playWav1.play("greeting.wav");    

   ^

C:\Users\thebe\AppData\Local\Temp\Temp3_audio-guestbook-main.zip\audio-guestbook-main\audio-guestbook\audio-guestbook.ino: In function 'void playAllRecordings()':

C:\Users\thebe\AppData\Local\Temp\Temp3_audio-guestbook-main.zip\audio-guestbook-main\audio-guestbook\audio-guestbook.ino:374:7: error: 'playWav1' was not declared in this scope

   playWav1.play(entry.name());

   ^

C:\Users\thebe\AppData\Local\Temp\Temp3_audio-guestbook-main.zip\audio-guestbook-main\audio-guestbook\audio-guestbook.ino:380:13: error: 'playWav1' was not declared in this scope

 while (!playWav1.isStopped()) { // this works for playWav

         ^

C:\Users\thebe\AppData\Local\Temp\Temp3_audio-guestbook-main.zip\audio-guestbook-main\audio-guestbook\audio-guestbook.ino: In function 'void playLastRecording()':

C:\Users\thebe\AppData\Local\Temp\Temp3_audio-guestbook-main.zip\audio-guestbook-main\audio-guestbook\audio-guestbook.ino:411:7: error: 'playWav1' was not declared in this scope

   playWav1.play(filename);

   ^

Error compiling for board Teensy 4.0."

Anyone can help me?

Where do I find MTP for teensy and why is multiple libraries were found appearing

Arduino: 1.8.19 (Windows 10), TD: 1.57, Board: "Teensy 4.0, Serial + MTP Disk (Experimental), 600 MHz, Faster, US English"

C:\Users\Dalton\Desktop\sketch_sep16a\sketch_sep16a.ino:30:24: fatal error: MTP_Teensy.h: No such file or directory

compilation terminated.

Multiple libraries were found for "SD.h"

Used: C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\SD

Not used: C:\Program Files (x86)\Arduino\libraries\SD

Error compiling for board Teensy 4.0.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

Missing library - MTP_Teensy.h

The new code posted 8 days ago refers to the library MTP_Teensy.h

I have tried searching for this library and found nothing. Can someone shed some light please?

fatal error: MTP_Teensy.h: No such file or directory / Question on the library used

When compiling, I get the error that MTP_Teensy.h could not be found. This library appears to be required with the latest additions from @DD4WH

The problem I have is that I couldn't find much information on how to get this library, i.e. I cannot find any library named like that in the Teensyduino Library Manager, and I don't know from which developer this is from to be able to locate and install the correct one.

Thank you so much in advance for your helpful tip, and overall for this great project :-)

Error: 'playWav1' was not declared in this scope

I tried to update my code to the newest code with the stability improvements. Unfortunately there is an Error.
I already adapted the boards & platform.txt and also see the new Audio Tweaks setting in the menu.
But something does not work with "AudioPlaySdWavX"

The following message comes up:

Audioguestbook_Sally:411: error: 'playWav1' was not declared in this scope
playWav1.play(filename);
^
'AudioPlaySdWavX' does not name a type

Honestly I also did not understand what to do with this sentence:
Do I have to do anything here or not? I did not get it (Sorry, maybe language difficulties. I am from Germany).
DO NOT copy the play_wav_sd.cpp and .h files to your Audio library: They should appear as extra tabs in your Arduino IDE, but are only of use for this project and will break other audio applications using SD playback!

teensy 4.0 with audio board

[code]
/**

  • Audio Guestbook, Copyright (c) 2022 Playful Technology
  • Tested using a Teensy 4.0 with Teensy Audio Shield, although should work
  • with minor modifications on other similar hardware
  • When handset is lifted, a pre-recorded greeting message is played, followed by a tone.
  • Then, recording starts, and continues until the handset is replaced.
  • Playback button allows all messages currently saved on SD card through earpiece
  • Files are saved on SD card as 44.1kHz, 16-bit, mono signed integer RAW audio format
  • --> changed this to WAV recording, DD4WH 2022_07_31
  • --> added MTP support, which enables copying WAV files from the SD card via the USB connection, DD4WH 2022_08_01
  • Frank DD4WH, August 1st 2022
  • for a DBP 611 telephone (closed contact when handheld is lifted) & with recording to WAV file
  • contact for switch button 0 is closed when handheld is lifted
  • GNU GPL v3.0 license

*/

#include <Bounce.h>
#include <Audio.h>
#include <Wire.h>
#include <SPI.h>
#include <SD.h>
#include <TimeLib.h>
#include <MTP_Teensy.h>
#include "play_sd_wav.h" // local copy with fixes

// DEFINES
// Define pins used by Teensy Audio Shield
#define SDCARD_CS_PIN 10
#define SDCARD_MOSI_PIN 7
#define SDCARD_SCK_PIN 14
// And those used for inputs
#define HOOK_PIN 0
#define PLAYBACK_BUTTON_PIN 1

#define noINSTRUMENT_SD_WRITE

// GLOBALS
// Audio initialisation code can be generated using the GUI interface at https://www.pjrc.com/teensy/gui/
// Inputs
AudioSynthWaveform waveform1; // To create the "beep" sfx
AudioInputI2S i2s2; // I2S input from microphone on audio shield
AudioPlaySdWavX playWav1; // Play 44.1kHz 16-bit PCM greeting WAV file
AudioRecordQueue queue1; // Creating an audio buffer in memory before saving to SD
AudioMixer4 mixer; // Allows merging several inputs to same output
AudioOutputI2S i2s1; // I2S interface to Speaker/Line Out on Audio shield
AudioConnection patchCord1(waveform1, 0, mixer, 0); // wave to mixer
AudioConnection patchCord3(playWav1, 0, mixer, 1); // wav file playback mixer
AudioConnection patchCord4(mixer, 0, i2s1, 0); // mixer output to speaker (L)
AudioConnection patchCord6(mixer, 0, i2s1, 1); // mixer output to speaker (R)
AudioConnection patchCord5(i2s2, 0, queue1, 0); // mic input to queue (L)
AudioControlSGTL5000 sgtl5000_1;

// Filename to save audio recording on SD card
char filename[15];
// The file object itself
File frec;

// Use long 40ms debounce time on both switches
Bounce buttonRecord = Bounce(HOOK_PIN, 40);
Bounce buttonPlay = Bounce(PLAYBACK_BUTTON_PIN, 40);

// Keep track of current state of the device
enum Mode {Initialising, Ready, Prompting, Recording, Playing};
Mode mode = Mode::Initialising;

float beep_volume = 0.04f; // not too loud :-)

uint32_t MTPcheckInterval; // default value of device check interval [ms]

// variables for writing to WAV file
unsigned long ChunkSize = 0L;
unsigned long Subchunk1Size = 16;
unsigned int AudioFormat = 1;
unsigned int numChannels = 1;
unsigned long sampleRate = 44100;
unsigned int bitsPerSample = 16;
unsigned long byteRate = sampleRatenumChannels(bitsPerSample/8);// samplerate x channels x (bitspersample / 8)
unsigned int blockAlign = numChannels*bitsPerSample/8;
unsigned long Subchunk2Size = 0L;
unsigned long recByteSaved = 0L;
unsigned long NumSamples = 0L;
byte byte1, byte2, byte3, byte4;

void setup() {

Serial.begin(9600);
while (!Serial && millis() < 5000) {
// wait for serial port to connect.
}
Serial.println("Serial set up correctly");
Serial.printf("Audio block set to %d samples\n",AUDIO_BLOCK_SAMPLES);
print_mode();
// Configure the input pins
pinMode(HOOK_PIN, INPUT_PULLUP);
pinMode(PLAYBACK_BUTTON_PIN, INPUT_PULLUP);

// Audio connections require memory, and the record queue
// uses this memory to buffer incoming audio.
AudioMemory(60);

// Enable the audio shield, select input, and enable output
sgtl5000_1.enable();
// Define which input on the audio shield to use (AUDIO_INPUT_LINEIN / AUDIO_INPUT_MIC)
sgtl5000_1.inputSelect(AUDIO_INPUT_MIC);
//sgtl5000_1.adcHighPassFilterDisable(); //
sgtl5000_1.volume(0.95);

mixer.gain(0, 1.0f);
mixer.gain(1, 1.0f);

// Play a beep to indicate system is online
waveform1.begin(beep_volume, 440, WAVEFORM_SINE);
wait(1000);
waveform1.amplitude(0);
delay(1000);

// Initialize the SD card
SPI.setMOSI(SDCARD_MOSI_PIN);
SPI.setSCK(SDCARD_SCK_PIN);
if (!(SD.begin(SDCARD_CS_PIN)))
{
// stop here if no SD card, but print a message
while (1) {
Serial.println("Unable to access the SD card");
delay(500);
}
}
else Serial.println("SD card correctly initialized");

// mandatory to begin the MTP session.
MTP.begin();

// Add SD Card
// MTP.addFilesystem(SD, "SD Card");
MTP.addFilesystem(SD, "Kais Audio guestbook"); // choose a nice name for the SD card volume to appear in your file explorer
Serial.println("Added SD card via MTP");
MTPcheckInterval = MTP.storage()->get_DeltaDeviceCheckTimeMS();

// Value in dB

// sgtl5000_1.micGain(15);
sgtl5000_1.micGain(5); // much lower gain is required for the AOM5024 electret capsule

// Synchronise the Time object used in the program code with the RTC time provider.
// See https://github.com/PaulStoffregen/Time
setSyncProvider(getTeensy3Time);

// Define a callback that will assign the correct datetime for any file system operations
// (i.e. saving a new audio recording onto the SD card)
FsDateTime::setCallback(dateTime);

mode = Mode::Ready; print_mode();
}

void loop() {
// First, read the buttons
buttonRecord.update();
buttonPlay.update();

switch(mode){
case Mode::Ready:
// Falling edge occurs when the handset is lifted --> 611 telephone
if (buttonRecord.fallingEdge()) {
Serial.println("Handset lifted");
mode = Mode::Prompting; print_mode();
}
else if(buttonPlay.fallingEdge()) {
//playAllRecordings();
playLastRecording();
}
break;

case Mode::Prompting:
  // Wait a second for users to put the handset to their ear
  wait(1000);
  // Play the greeting inviting them to record their message
  playWav1.play("greeting.wav");    
  // Wait until the  message has finished playing

// while (playWav1.isPlaying()) {
while (!playWav1.isStopped()) {
// Check whether the handset is replaced
buttonRecord.update();
buttonPlay.update();
// Handset is replaced
if(buttonRecord.risingEdge()) {
playWav1.stop();
mode = Mode::Ready; print_mode();
return;
}
if(buttonPlay.fallingEdge()) {
playWav1.stop();
//playAllRecordings();
playLastRecording();
return;
}

  }
  // Debug message
  Serial.println("Starting Recording");
  // Play the tone sound effect
  waveform1.begin(beep_volume, 440, WAVEFORM_SINE);
  wait(1250);
  waveform1.amplitude(0);
  // Start the recording function
  startRecording();
  break;

case Mode::Recording:
  // Handset is replaced
  if(buttonRecord.risingEdge()){
    // Debug log
    Serial.println("Stopping Recording");
    // Stop recording
    stopRecording();
    // Play audio tone to confirm recording has ended
    end_Beep();
  }
  else {
    continueRecording();
  }
  break;

case Mode::Playing: // to make compiler happy
  break;  

case Mode::Initialising: // to make compiler happy
  break;  

}

MTP.loop(); // This is mandatory to be placed in the loop code.
}

void setMTPdeviceChecks(bool nable)
{
if (nable)
{
MTP.storage()->set_DeltaDeviceCheckTimeMS(MTPcheckInterval);
Serial.print("En");
}
else
{
MTP.storage()->set_DeltaDeviceCheckTimeMS((uint32_t) -1);
Serial.print("Dis");
}
Serial.println("abled MTP storage device checks");
}

#if defined(INSTRUMENT_SD_WRITE)
static uint32_t worstSDwrite, printNext;
#endif // defined(INSTRUMENT_SD_WRITE)

void startRecording() {
setMTPdeviceChecks(false); // disable MTP device checks while recording
#if defined(INSTRUMENT_SD_WRITE)
worstSDwrite = 0;
printNext = 0;
#endif // defined(INSTRUMENT_SD_WRITE)
// Find the first available file number
// for (uint8_t i=0; i<9999; i++) { // BUGFIX uint8_t overflows if it reaches 255
for (uint16_t i=0; i<9999; i++) {
// Format the counter as a five-digit number with leading zeroes, followed by file extension
snprintf(filename, 11, " %05d.wav", i);
// Create if does not exist, do not open existing, write, sync after write
if (!SD.exists(filename)) {
break;
}
}
frec = SD.open(filename, FILE_WRITE);
Serial.println("Opened file !");
if(frec) {
Serial.print("Recording to ");
Serial.println(filename);
queue1.begin();
mode = Mode::Recording; print_mode();
recByteSaved = 0L;
}
else {
Serial.println("Couldn't open file to record!");
}
}

void continueRecording() {
#if defined(INSTRUMENT_SD_WRITE)
uint32_t started = micros();
#endif // defined(INSTRUMENT_SD_WRITE)
#define NBLOX 16
// Check if there is data in the queue
if (queue1.available() >= NBLOX) {
byte buffer[NBLOXAUDIO_BLOCK_SAMPLESsizeof(int16_t)];
// Fetch 2 blocks from the audio library and copy
// into a 512 byte buffer. The Arduino SD library
// is most efficient when full 512 byte sector size
// writes are used.
for (int i=0;i<NBLOX;i++)
{
memcpy(buffer+iAUDIO_BLOCK_SAMPLESsizeof(int16_t), queue1.readBuffer(), AUDIO_BLOCK_SAMPLES*sizeof(int16_t));
queue1.freeBuffer();
}
// Write all 512 bytes to the SD card
frec.write(buffer, sizeof buffer);
recByteSaved += sizeof buffer;
}

#if defined(INSTRUMENT_SD_WRITE)
started = micros() - started;
if (started > worstSDwrite)
worstSDwrite = started;

if (millis() >= printNext)
{
Serial.printf("Worst write took %luus\n",worstSDwrite);
worstSDwrite = 0;
printNext = millis()+250;
}
#endif // defined(INSTRUMENT_SD_WRITE)
}

void stopRecording() {
// Stop adding any new data to the queue
queue1.end();
// Flush all existing remaining data from the queue
while (queue1.available() > 0) {
// Save to open file
frec.write((byte*)queue1.readBuffer(), AUDIO_BLOCK_SAMPLESsizeof(int16_t));
queue1.freeBuffer();
recByteSaved += AUDIO_BLOCK_SAMPLES
sizeof(int16_t);
}
writeOutHeader();
// Close the file
frec.close();
Serial.println("Closed file");
mode = Mode::Ready; print_mode();
setMTPdeviceChecks(true); // enable MTP device checks, recording is finished
}

void playAllRecordings() {
// Recording files are saved in the root directory
File dir = SD.open("/");

while (true) {
File entry = dir.openNextFile();
if (strstr(entry.name(), "greeting"))
{
entry = dir.openNextFile();
}
if (!entry) {
// no more files
entry.close();
end_Beep();
break;
}
//int8_t len = strlen(entry.name()) - 4;
// if (strstr(strlwr(entry.name() + (len - 4)), ".raw")) {
// if (strstr(strlwr(entry.name() + (len - 4)), ".wav")) {
// the lines above throw a warning, so I replace them with this (which is also easier to read):
if (strstr(entry.name(), ".wav") || strstr(entry.name(), ".WAV")) {
Serial.print("Now playing ");
Serial.println(entry.name());
// Play a short beep before each message
waveform1.amplitude(beep_volume);
wait(750);
waveform1.amplitude(0);
// Play the file
playWav1.play(entry.name());
mode = Mode::Playing; print_mode();
}
entry.close();

// while (playWav1.isPlaying()) { // strangely enough, this works for playRaw, but it does not work properly for playWav
while (!playWav1.isStopped()) { // this works for playWav
buttonPlay.update();
buttonRecord.update();
// Button is pressed again
// if(buttonPlay.risingEdge() || buttonRecord.risingEdge()) { // FIX
if(buttonPlay.fallingEdge() || buttonRecord.risingEdge()) {
playWav1.stop();
mode = Mode::Ready; print_mode();
return;
}
}
}
// All files have been played
mode = Mode::Ready; print_mode();
}

void playLastRecording() {
// Find the first available file number
uint16_t idx = 0;
for (uint16_t i=0; i<9999; i++) {
// Format the counter as a five-digit number with leading zeroes, followed by file extension
snprintf(filename, 11, " %05d.wav", i);
// check, if file with index i exists
if (!SD.exists(filename)) {
idx = i - 1;
break;
}
}
// now play file with index idx == last recorded file
snprintf(filename, 11, " %05d.wav", idx);
Serial.println(filename);
playWav1.play(filename);
mode = Mode::Playing; print_mode();
while (!playWav1.isStopped()) { // this works for playWav
buttonPlay.update();
buttonRecord.update();
// Button is pressed again
// if(buttonPlay.risingEdge() || buttonRecord.risingEdge()) { // FIX
if(buttonPlay.fallingEdge() || buttonRecord.risingEdge()) {
playWav1.stop();
mode = Mode::Ready; print_mode();
return;
}
}
// file has been played
mode = Mode::Ready; print_mode();
end_Beep();
}

// Retrieve the current time from Teensy built-in RTC
time_t getTeensy3Time(){
return Teensy3Clock.get();
}

// Callback to assign timestamps for file system operations
void dateTime(uint16_t* date, uint16_t* time, uint8_t* ms10) {

// Return date using FS_DATE macro to format fields.
*date = FS_DATE(year(), month(), day());

// Return time using FS_TIME macro to format fields.
*time = FS_TIME(hour(), minute(), second());

// Return low time bits in units of 10 ms.
*ms10 = second() & 1 ? 100 : 0;
}

// Non-blocking delay, which pauses execution of main program logic,
// but while still listening for input
void wait(unsigned int milliseconds) {
elapsedMillis msec=0;

while (msec <= milliseconds) {
buttonRecord.update();
buttonPlay.update();
if (buttonRecord.fallingEdge()) Serial.println("Button (pin 0) Press");
if (buttonPlay.fallingEdge()) Serial.println("Button (pin 1) Press");
if (buttonRecord.risingEdge()) Serial.println("Button (pin 0) Release");
if (buttonPlay.risingEdge()) Serial.println("Button (pin 1) Release");
}
}

void writeOutHeader() { // update WAV header with final filesize/datasize

// NumSamples = (recByteSaved8)/bitsPerSample/numChannels;
// Subchunk2Size = NumSamples
numChannels*bitsPerSample/8; // number of samples x number of channels x number of bytes per sample
Subchunk2Size = recByteSaved - 42; // because we didn't make space for the header to start with! Lose 21 samples...
ChunkSize = Subchunk2Size + 34; // was 36;
frec.seek(0);
frec.write("RIFF");
byte1 = ChunkSize & 0xff;
byte2 = (ChunkSize >> 8) & 0xff;
byte3 = (ChunkSize >> 16) & 0xff;
byte4 = (ChunkSize >> 24) & 0xff;
frec.write(byte1); frec.write(byte2); frec.write(byte3); frec.write(byte4);
frec.write("WAVE");
frec.write("fmt ");
byte1 = Subchunk1Size & 0xff;
byte2 = (Subchunk1Size >> 8) & 0xff;
byte3 = (Subchunk1Size >> 16) & 0xff;
byte4 = (Subchunk1Size >> 24) & 0xff;
frec.write(byte1); frec.write(byte2); frec.write(byte3); frec.write(byte4);
byte1 = AudioFormat & 0xff;
byte2 = (AudioFormat >> 8) & 0xff;
frec.write(byte1); frec.write(byte2);
byte1 = numChannels & 0xff;
byte2 = (numChannels >> 8) & 0xff;
frec.write(byte1); frec.write(byte2);
byte1 = sampleRate & 0xff;
byte2 = (sampleRate >> 8) & 0xff;
byte3 = (sampleRate >> 16) & 0xff;
byte4 = (sampleRate >> 24) & 0xff;
frec.write(byte1); frec.write(byte2); frec.write(byte3); frec.write(byte4);
byte1 = byteRate & 0xff;
byte2 = (byteRate >> 8) & 0xff;
byte3 = (byteRate >> 16) & 0xff;
byte4 = (byteRate >> 24) & 0xff;
frec.write(byte1); frec.write(byte2); frec.write(byte3); frec.write(byte4);
byte1 = blockAlign & 0xff;
byte2 = (blockAlign >> 8) & 0xff;
frec.write(byte1); frec.write(byte2);
byte1 = bitsPerSample & 0xff;
byte2 = (bitsPerSample >> 8) & 0xff;
frec.write(byte1); frec.write(byte2);
frec.write("data");
byte1 = Subchunk2Size & 0xff;
byte2 = (Subchunk2Size >> 8) & 0xff;
byte3 = (Subchunk2Size >> 16) & 0xff;
byte4 = (Subchunk2Size >> 24) & 0xff;
frec.write(byte1); frec.write(byte2); frec.write(byte3); frec.write(byte4);
frec.close();
Serial.println("header written");
Serial.print("Subchunk2: ");
Serial.println(Subchunk2Size);
}

void end_Beep(void) {
waveform1.frequency(523.25);
waveform1.amplitude(beep_volume);
wait(250);
waveform1.amplitude(0);
wait(250);
waveform1.amplitude(beep_volume);
wait(250);
waveform1.amplitude(0);
wait(250);
waveform1.amplitude(beep_volume);
wait(250);
waveform1.amplitude(0);
wait(250);
waveform1.amplitude(beep_volume);
wait(250);
waveform1.amplitude(0);
}

void print_mode(void) { // only for debugging
Serial.print("Mode switched to: ");
// Initialising, Ready, Prompting, Recording, Playing
if(mode == Mode::Ready) Serial.println(" Ready");
else if(mode == Mode::Prompting) Serial.println(" Prompting");
else if(mode == Mode::Recording) Serial.println(" Recording");
else if(mode == Mode::Playing) Serial.println(" Playing");
else if(mode == Mode::Initialising) Serial.println(" Initialising");
else Serial.println(" Undefined");
}
[/code]

getting this error message

Arduino: 1.8.19 (Windows 10), TD: 1.57, Board: "Teensy 4.0, Serial, 600 MHz, Faster, US English"

Multiple libraries were found for "SD.h"

C:\Users\iandi\Documents\Arduino\audio-guestbook-main\audio-guestbook\audio-guestbook.ino:30:24: fatal error: MTP_Teensy.h: No such file or directory

Used: C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\SD

compilation terminated.

Not used: C:\Program Files (x86)\Arduino\libraries\SD

Error compiling for board Teensy 4.0.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

Volume issues & Regular ticking sounds on both playback & recorded files

I've just built the project and confirmed that the logic is working correctly for my phone via serial monitor.

The first issue I'm having is that the playback volume through the handset is very quiet, almost can't hear it in a quiet room. I have tried increasing the value in

sgtl5000_1.volume(0.95)

With no noticeable effect.

The second issue I'm having is that there is a regular ticking sound (4-5/second) over the handset speaker which is also reflected in the recorded .wav files. I'm guessing some connection is bridged but I can find any bad solder joints

time / date of files

When a new file is created, the properties do not show the correct date and time, how can I change this?
Currently time it displays the year 1990 or so....

Or is it possible to add the date and time to the file names?
For example 2302101130.wav or similar, if so where do I have to make changes in the ino file?

fatal error: MTP_Teensy.h: No such file or directory

Any help would be appreciated.

I am running into this error:

/Users/cristianomesquita/Documents/Arduino/sketch_sep04a/sketch_sep04a.ino:30:24: fatal error: MTP_Teensy.h: No such file or directory
compilation terminated.
Error compiling for board Teensy 4.0.

Issue With Audio/Recording

After setting up the Teensy/Audio adapter and connecting it to the phone, I am running into some issues. I am able to confirm that the pickup/hang-up logic is working correctly via the debugger, which is great.
Where I start having issues is with the audio playback and the recording. While I can see in the debugger that the greeting prompt is being sent to the speaker, I am unable to hear anything on the phone. Secondly, when recordings are made, which I can successfully see on the SD card and listen to with Audacity, all I hear is static. I can attach an example audio file if that would help.

This is my first time soldering pins, so I am concerned that maybe there was an issue with some of the connections. Is anyone familiar with what issues could cause these symptoms? Any assistance here would be greatly appreciated!

Clarify External Power

Not code related but looking to get clarity on external power options. Using the Teensy 4.0, the docs say that it is 3.3 volts only, but I have also seen a number of people still recommend or go with 5-volt options.

Teensy 4.0 power details:
https://www.pjrc.com/store/teensy40.html
https://www.pjrc.com/teensy/techspecs.html
https://www.pjrc.com/store/teensy40.html#power

I then get really confused looking at the link below regarding external power with the Teensy 4.0:
-https://forum.pjrc.com/threads/64468-Teensy40-only-3-3V-power-supply?p=259469%26viewfull=1#post259469
-there is another link that I can't find that talked about external power

Error Message when attempting to upload

Hi,

I am getting an error message when I am attempting to upload the code:

Arduino: 1.8.16 (Windows 10), TD: 1.57, Board: "Teensy 4.0, Serial, 600 MHz, Faster, United Kingdom"

In file included from C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Audio/Audio.h:129:0,

Multiple libraries were found for "SD.h"

             from C:\Users\Kiel Wilkinson\Downloads\AudioGuestbook__3_.fzz\AudioGuestbook__3_.fzz.ino:25:

Used: C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\SD

C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Audio/play_serialflash_raw.h:33:25: fatal error: SerialFlash.h: No such file or directory not used: C:\Program Files (x86)\Arduino\libraries\SD

compilation terminated.

Error compiling for board Teensy 4.0.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

Any ideas??? Any help woul be much appreciated.

Thank you

Kiel

Bounce.h fatal error

Arduino: 1.8.19 (Windows 10), TD: 1.57, Board: "Teensy 4.0, Serial + MTP Disk (Experimental), 600 MHz, Faster, US English"

C:\Users\User\Downloads\audio-guestbook-main\audio-guestbook-main\audio-guestbook\audio-guestbook.ino:24:20: fatal error: Bounce.h: No such file or directory

compilation terminated.

Error compiling for board Teensy 4.0.

New to coding. Trying to get this set up for my daughter's wedding. A little help would be much appreciated.

Thank you

Nothing happens after uploading program to Teensy

What an amazing tutorial you've put together Alistair! Thank you so much for this!
I'm an absolute beginner when it comes to all this and have managed to put together all the hardware together according to the tutorial (as well as the updates required to libraries with MTP etc), and also the code says compilation complete and then upload complete to the Teensy. Yet, after doing this and following all the steps, when plugging the board into power nothing seems to happen. There's no beep at all and my greeting doesn't play either. I'm not too sure where to go from here. The only thing that differs with my setup is that I didn't include a playback button as I didn't deem it necessary. Would this affect how things are behaving if the code still thinks there's a playback button but there isn't? If you need more information to debunk, please let me know what you need! Would really appreciate understanding where to go from here as I'm at a lost and feel like I'm soooooo close! Thank you!

Record a greeting

Has anyone worked out the code to press a button and record a greeting, instead of copying to sd card?

Issue playing WAV files

Playing WAV file greeting may cause issues with Teensy, for me it would crash the program after playing a long loud beep. This thread identifies the issue as well as the solution, which worked for me.

Should put a note in the README so that others don't have to go searching for solutions.

Recorded .wav files skipping

Hello!

Thanks so much for developing this awesome code!

We managed to connect everything seemingly correctly. The greeting.wav message works on pickup, gives a beep, and it takes in a recorded message. However, when trying to play back that recorded message on the computer, it skips, so we hear like every 3rd word. Any ideas as to why this might be happening?

Thank you!
Amanda

Issues with code

I have no clue what I am doing. I will pay for someone to code this for me. These are the error messages i get.

Arduino: 1.8.19 (Windows 10), TD: 1.57, Board: "Teensy 4.0, Serial + MTP Disk (Experimental), 600 MHz, Faster, US English"

In file included from C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Audio/Audio.h:129:0,

Multiple libraries were found for "SD.h"

             from C:\Users\Luke\Documents\Arduino\sketch_jan24a\sketch_jan24a.ino:24:

Used: C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\SD

Not used: C:\Program Files (x86)\Arduino\libraries\SD

C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Audio/play_serialflash_raw.h:33:25: fatal error: SerialFlash.h: No such file or directory

compilation terminated.

Error compiling for board Teensy 4.0.

Invalid library found in C:\Users\Luke\Documents\Arduino\libraries\libraries: no headers files (.h) found in C:\Users\Luke\Documents\Arduino\libraries\libraries

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

Can someone email me @ [email protected] I will pay you to get this solved for me. I have an event this weekend. Please help! Thank you! God bless!

Need updated working code

After watching the video and following along with the code you provided on the website, I've noticed some slight differences between the youtube video and what's provided on the website. Is the code on the website more up-to-date than the one shown in the video? Also, is this a plug-and-play code or will it need tweaking?

Several Problems AND SOLUTIONS I Found During My Build

It took me a lot of hunting around to fix some of the code issues I was encountering and I'd thought I'd explain my solutions to those of you who are struggling with the same problems. The answers were pulled from this project's main page, the "Closed Issues" board, and a few other places on the internet, but here they are consolidated.

My experiences only pertain to the Github code for this project as of January 22, 2023 and the specific hardware/software that I used.

My hardware:
Teensy 4.0 board
Teensy4_AUDIO Audio Shield
Momentary pushbutton
Vintage telephone

My software:
Arduino IDE 1.8.19
Teensyduino 1.57 using Windows installer

First steps: I did all of the installation adjustments included on the audio-guestbook Github main page, such as

  • copied boards.local.txt
  • copied platform.txt
  • Changed "Audio tweaks" to "Bigger blocks (256 samples)"

I then had several compiling errors that I had to hunt around for solutions to

Problem:
AudioPlaySdWavX does not name a type
&
'playWav1' was not declared in this scope
Solution:
Inside your sketch, go to the "Sketch" dropdown at the top, choose "Add File" and add play_wav_sd.cpp and repeat with play_wav_sd.h files that were in the Github code download.
Leave those tabs open, then try Verifying your sketch and you should lose those errors.

Problem:
Multiple libraries were found for "SD.h"
Solution:
I cut/pasted the folder 'C:\Program Files (x86)\Arduino\libraries\SD' out of the Arduino libraries directory and saved it elsewhere on my computer for safe keeping. Now, the only 'SD' folder should be under Arduino\hardware\teensy\avr\libraries\

Problem:
Compiling error involving SerialFlash.h
Solution:
Re-ran the TeensyDuino installer and added the 'SerialFlash' library

Problem:
Multiple errors involving MTP_Teensy.h
Solution:
Download the Github code from https://github.com/KurtE/MTP_Teensy and unzip the folder into 'C:\Program Files (x86)\Arduino\libraries'
Then, in your Arduino sketch, select from the dropdowns at the top "Tools > USB Type > Serial + MTP Disk (Experimental)"

Problem:
Audio was clipping (breaking up) during playback after I got everything "working"
Solution:
There are two volume adjustments in the code that I fiddled with. Use CTRL+F in the code to find "sgt15000_1.volume(0.95)". The 0.95 is 95% volume on the headset speaker, which was too loud. I dropped it down to 0.7 and it stopped clipping on playback.
I also adjusted the "sgt15000_1.micGain(5)", which is how loud the microphone on the headset is recorded in the file. I dropped it to (4) because the recordings sounded blown out.

Problem:
My greeting message wasn't playing back, I would just get a single "beep" when I lifted the handset
Solution:
I downloaded Audacity and opened my greeting message, then exported it using 44.1kHz and 16-bit PCM as a new WAV file. I also had a stereo recording, so I had to delete one of the tracks to make it "mono". That fixed the playback problem.

Problem:
The code compiled correctly (finally), but the handset wasn't responding properly and I was hearing a constant clicking noise in the speaker.
Solution:
My phone had a lot of shared terminals in the internal wiring. I disconnected all of the wires from the phone's terminals and directly wired each wire from the speaker/microphone/handset contact/pushbutton to the inputs/outputs of my Teensy board. This solved the clicking issue and after troubleshooting my code, it also solved the audio issues.

wait() function leads to unwanted modes in certain situations

I did some testing with my telephone (German W48 phone, contact closes on handheld lift), and discovered the following behaviour: When uplifting the handset and before the greeting.wav is played, there is a custom wait() function being called, with input parameter of 1000ms.

case Mode::Prompting:
// Wait a second for users to put the handset to their ear
wait(1000);

If I now hang up the handset during the wait (so before the 1000ms are over) the phone STAYS in mode PROMTING, even when the 1000ms are over, and I can see the debug message "Button (pin 0) Release". This means, while the handset is on the phone, the greeting.wav is played and also the recording is being started afterwards - with the risk that a very long recording is being produced in case no one picks up the phone again and the SD card is written full.

If I exchange the wait(1000); function with a delay(1000); function in this line of code, everything works as expected, meaning also a short uplifting of the handset (<1000ms) will not lead to an unwanted state and brings the phone finally into READY mode again.

I don't really understand where this problem comes from (I think it is implementation related), and I'm not sure if it also affects other areas of the code where the wait() function is being used under certain situations.

Cannot write new Boards.local and platform txt files to Avr folder.

Likely a silly question/issue...

Cannot write new Boards.local and platform txt files to Avr folder.

Getting message:
You don't have permission to save in this location.
Contact the administrator to obtain permission.

Is this saying I need to ask permission from Teensy where the install came from, or from the administrator of my PC. In that case, I am the Administrator.

Stuck in "ready" mode

Hi all,
I'm using @DD4WH fork here, struggled a bit for setting up my Teensy 4.0 w/ Rev D2 Audio Shield, found #36 and managed to fix some issues, but when I load code to the Teensy I hear the initial "beep" and on Serial Monitor I get those lines

Serial set up correctly
Mode switched to:  Initialising
SD card correctly initialized
Add **SDClass** file system
Added SD card via MTP
Mode switched to:  Ready
&&&&& Dump MTPStorage Loop Data &&&&&
	Callback Data:		0	0x0	0
		1	0xd115	1
		2	0x0	0
		3	0x0	0
		4	0x0	0
	File Systems:
		0	0x200035c8	1

and nothing happens. Any hints? Thank you in advance!

Recordings stop and speed up

Hello

Many thanks for the value you have given so far and also for the update regarding the teensy 4.1
We have manged to build several phones with the teensy 4.0 - after a few bumps everything works perfectly.

Now that the 4.0 is sold out everywhere we switched to 4.1 and an unexpected issue has come up.

Recordings cut after a few seconds and speed up.

May this have something to do with the SD card writing? I've been using the same one for the 4.0 projects with no problem at all.
Does anyone have a suggestion regarding this?

I would be extremely grateful for any tips.

Thank you
T

Audio recording problems

Hello, I tried to read through everyone else's problems before posting, my audio files are recording blank. I checked my solder connections and they seem ok, but obviously I am a newbie. Im using a teensy 4.1 on the audio shield (so I do have overhanging pins from the longer 4.1 board). using the serial monitor, it all appears to working, however I do not have anything coming through on the handset. I did try the same setup from the video with 3.5 breakout board, etc. Desperate for help as my wedding is saturday.

multiple libraries were found for SD.h

I'm very new to this and I keep getting the error message: "multiple libraries were found for SD.h" while attempting to compile. Any help would be greatly appreciated

Problem with last recording saving.

I am excited to have worked through all me issues except one. When the phone finishes its last recording, it does not seem to save the file correctly. I can do another recording to force it to save the recording before but if someone were to think it was done without make that extra recording then I'd lose that last person. When I try to play that last on back it says. "This file isn't playable" and suggests that its corrupt. Has anyone seen this problem? Thanks

'AudioPlaySdWavX' does not name a type

Why am I getting these compile errors?

`Arduino: 1.8.19 (Windows 10), TD: 1.57, Board: "Teensy 4.0, Serial + MTP Disk (Experimental), 600 MHz, Faster, US English"

C:\Users\conce\Downloads\audio-guestbook-main\audio-guestbook-main\audio-guestbook\audio-guestbook.ino:49:1: error: 'AudioPlaySdWavX' does not name a type

AudioPlaySdWavX playWav1; // Play 44.1kHz 16-bit PCM greeting WAV file

^

C:\Users\conce\Downloads\audio-guestbook-main\audio-guestbook-main\audio-guestbook\audio-guestbook.ino:54:28: error: 'playWav1' was not declared in this scope

AudioConnection patchCord3(playWav1, 0, mixer, 1); // wav file playback mixer

                        ^

C:\Users\conce\Downloads\audio-guestbook-main\audio-guestbook-main\audio-guestbook\audio-guestbook.ino: In function 'void loop()':

C:\Users\conce\Downloads\audio-guestbook-main\audio-guestbook-main\audio-guestbook\audio-guestbook.ino:185:7: error: 'playWav1' was not declared in this scope

   playWav1.play("greeting.wav");    

   ^

C:\Users\conce\Downloads\audio-guestbook-main\audio-guestbook-main\audio-guestbook\audio-guestbook.ino: In function 'void playAllRecordings()':

C:\Users\conce\Downloads\audio-guestbook-main\audio-guestbook-main\audio-guestbook\audio-guestbook.ino:374:7: error: 'playWav1' was not declared in this scope

   playWav1.play(entry.name());

   ^

C:\Users\conce\Downloads\audio-guestbook-main\audio-guestbook-main\audio-guestbook\audio-guestbook.ino:380:13: error: 'playWav1' was not declared in this scope

 while (!playWav1.isStopped()) { // this works for playWav

         ^

C:\Users\conce\Downloads\audio-guestbook-main\audio-guestbook-main\audio-guestbook\audio-guestbook.ino: In function 'void playLastRecording()':

C:\Users\conce\Downloads\audio-guestbook-main\audio-guestbook-main\audio-guestbook\audio-guestbook.ino:411:7: error: 'playWav1' was not declared in this scope

   playWav1.play(filename);

   ^

Error compiling for board Teensy 4.0.

Invalid library found in C:\Program Files (x86)\Arduino\libraries\SDBackup: no headers files (.h) found in C:\Program Files (x86)\Arduino\libraries\SDBackup

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
`

Teensy 4.1

hi,
i am a teensy newbie (some arduiono expirience) from vienna.
i am using arduiono IDE Ver.1.8.19 and teensyduiono 1.57 a teensy 4.1 with a rev d audio shield.
i changed the preferences dir to the /teensy/avr/libraries path

and i am getting always a compilation error

Arduino: 1.8.19 (Windows 10), TD: 1.57, Board: "Teensy 4.1, Serial, 600 MHz, Faster, US English"

Using board 'teensy41' from platform in folder: C:\Program Files (x86)\Arduino\hardware\teensy\avr

Using core 'teensy4' from platform in folder: C:\Program Files (x86)\Arduino\hardware\teensy\avr

Detecting libraries used...

"C:\Program Files (x86)\Arduino\hardware\teensy/../tools/arm/bin/arm-none-eabi-g++" -E -CC -x c++ -w -g -Wall -ffunction-sections -fdata-sections -nostdlib -std=gnu++14 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -D__IMXRT1062__ -DTEENSYDUINO=157 -DARDUINO=10819 -DARDUINO_TEENSY41 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH "-IC:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4" "C:\Users\armin\AppData\Local\Temp\arduino_build_625252\sketch\audio-guestbook.ino.cpp" -o nul

Alternatives for Bounce.h: [Bounce]

ResolveLibrary(Bounce.h)

-> candidates: [Bounce]

"C:\Program Files (x86)\Arduino\hardware\teensy/../tools/arm/bin/arm-none-eabi-g++" -E -CC -x c++ -w -g -Wall -ffunction-sections -fdata-sections -nostdlib -std=gnu++14 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -D__IMXRT1062__ -DTEENSYDUINO=157 -DARDUINO=10819 -DARDUINO_TEENSY41 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH "-IC:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4" "-IC:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Bounce" "C:\Users\armin\AppData\Local\Temp\arduino_build_625252\sketch\audio-guestbook.ino.cpp" -o nul

Alternatives for Audio.h: [[email protected]]

ResolveLibrary(Audio.h)

-> candidates: [[email protected]]

"C:\Program Files (x86)\Arduino\hardware\teensy/../tools/arm/bin/arm-none-eabi-g++" -E -CC -x c++ -w -g -Wall -ffunction-sections -fdata-sections -nostdlib -std=gnu++14 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -D__IMXRT1062__ -DTEENSYDUINO=157 -DARDUINO=10819 -DARDUINO_TEENSY41 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH "-IC:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4" "-IC:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Bounce" "-IC:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Audio" "C:\Users\armin\AppData\Local\Temp\arduino_build_625252\sketch\audio-guestbook.ino.cpp" -o nul

Alternatives for SPI.h: [[email protected]]

ResolveLibrary(SPI.h)

-> candidates: [[email protected]]

"C:\Program Files (x86)\Arduino\hardware\teensy/../tools/arm/bin/arm-none-eabi-g++" -E -CC -x c++ -w -g -Wall -ffunction-sections -fdata-sections -nostdlib -std=gnu++14 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -D__IMXRT1062__ -DTEENSYDUINO=157 -DARDUINO=10819 -DARDUINO_TEENSY41 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH "-IC:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4" "-IC:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Bounce" "-IC:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Audio" "-IC:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\SPI" "C:\Users\armin\AppData\Local\Temp\arduino_build_625252\sketch\audio-guestbook.ino.cpp" -o nul

Alternatives for SD.h: [[email protected] [email protected]]

ResolveLibrary(SD.h)

-> candidates: [[email protected] [email protected]]

"C:\Program Files (x86)\Arduino\hardware\teensy/../tools/arm/bin/arm-none-eabi-g++" -E -CC -x c++ -w -g -Wall -ffunction-sections -fdata-sections -nostdlib -std=gnu++14 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -D__IMXRT1062__ -DTEENSYDUINO=157 -DARDUINO=10819 -DARDUINO_TEENSY41 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH "-IC:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4" "-IC:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Bounce" "-IC:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Audio" "-IC:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\SPI" "-IC:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\SD\src" "C:\Users\armin\AppData\Local\Temp\arduino_build_625252\sketch\audio-guestbook.ino.cpp" -o nul

Alternatives for SdFat.h: [[email protected]]

ResolveLibrary(SdFat.h)

-> candidates: [[email protected]]

"C:\Program Files (x86)\Arduino\hardware\teensy/../tools/arm/bin/arm-none-eabi-g++" -E -CC -x c++ -w -g -Wall -ffunction-sections -fdata-sections -nostdlib -std=gnu++14 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -D__IMXRT1062__ -DTEENSYDUINO=157 -DARDUINO=10819 -DARDUINO_TEENSY41 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH "-IC:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4" "-IC:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Bounce" "-IC:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Audio" "-IC:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\SPI" "-IC:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\SD\src" "-IC:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\SdFat\src" "C:\Users\armin\AppData\Local\Temp\arduino_build_625252\sketch\audio-guestbook.ino.cpp" -o nul

Alternatives for SerialFlash.h: [[email protected]]

ResolveLibrary(SerialFlash.h)

-> candidates: [[email protected]]

"C:\Program Files (x86)\Arduino\hardware\teensy/../tools/arm/bin/arm-none-eabi-g++" -E -CC -x c++ -w -g -Wall -ffunction-sections -fdata-sections -nostdlib -std=gnu++14 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -D__IMXRT1062__ -DTEENSYDUINO=157 -DARDUINO=10819 -DARDUINO_TEENSY41 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH "-IC:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4" "-IC:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Bounce" "-IC:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Audio" "-IC:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\SPI" "-IC:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\SD\src" "-IC:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\SdFat\src" "-IC:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\SerialFlash" "C:\Users\armin\AppData\Local\Temp\arduino_build_625252\sketch\audio-guestbook.ino.cpp" -o nul

Alternatives for Wire.h: [[email protected]]

ResolveLibrary(Wire.h)

-> candidates: [[email protected]]

"C:\Program Files (x86)\Arduino\hardware\teensy/../tools/arm/bin/arm-none-eabi-g++" -E -CC -x c++ -w -g -Wall -ffunction-sections -fdata-sections -nostdlib -std=gnu++14 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -D__IMXRT1062__ -DTEENSYDUINO=157 -DARDUINO=10819 -DARDUINO_TEENSY41 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH "-IC:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4" "-IC:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Bounce" "-IC:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Audio" "-IC:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\SPI" "-IC:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\SD\src" "-IC:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\SdFat\src" "-IC:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\SerialFlash" "-IC:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Wire" "C:\Users\armin\AppData\Local\Temp\arduino_build_625252\sketch\audio-guestbook.ino.cpp" -o nul

Alternatives for TimeLib.h: [[email protected]]

ResolveLibrary(TimeLib.h)

-> candidates: [[email protected]]

"C:\Program Files (x86)\Arduino\hardware\teensy/../tools/arm/bin/arm-none-eabi-g++" -E -CC -x c++ -w -g -Wall -ffunction-sections -fdata-sections -nostdlib -std=gnu++14 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -D__IMXRT1062__ -DTEENSYDUINO=157 -DARDUINO=10819 -DARDUINO_TEENSY41 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH "-IC:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4" "-IC:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Bounce" "-IC:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Audio" "-IC:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\SPI" "-IC:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\SD\src" "-IC:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\SdFat\src" "-IC:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\SerialFlash" "-IC:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Wire" "-IC:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Time" "C:\Users\armin\AppData\Local\Temp\arduino_build_625252\sketch\audio-guestbook.ino.cpp" -o nul

Alternatives for MTP_Teensy.h: []

ResolveLibrary(MTP_Teensy.h)

-> candidates: []

Mehrere Bibliotheken wurden für "SD.h" gefunden

C:\Users\armin\Documents\Arduino sketch\audio-guestbook-main\audio-guestbook\audio-guestbook.ino:30:24: fatal error: MTP_Teensy.h: No such file or directory

Benutzt: C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\SD

compilation terminated.

Nicht benutzt: C:\Program Files (x86)\Arduino\libraries\SD

Bibliothek Bounce im Ordner: C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Bounce (legacy) wird verwendet

Bibliothek Audio in Version 1.3 im Ordner: C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Audio wird verwendet

Bibliothek SPI in Version 1.0 im Ordner: C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\SPI wird verwendet

Bibliothek SD in Version 2.0.0 im Ordner: C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\SD wird verwendet

Bibliothek SdFat in Version 2.1.2 im Ordner: C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\SdFat wird verwendet

Bibliothek SerialFlash in Version 0.5 im Ordner: C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\SerialFlash wird verwendet

Bibliothek Wire in Version 1.0 im Ordner: C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Wire wird verwendet

Bibliothek Time in Version 1.6.1 im Ordner: C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Time wird verwendet

Fehler beim Kompilieren für das Board Teensy 4.1.

Microphone test during setup

Hello,

I would like to have an option to test the microphone during initial setup (after plugging in). A non working microphone would be a desaster at a party and all other components can be tested during normal operation.

  • Speaker with greeting message & also proofs that SD card is inside
  • Lifting by lifting :)

But nothing to ensure that the microphone works. Of course I could use the additional button and use the playback function. But my telephone has a stone housing and I don't want to drill a hole inside.

I thought maybe there is an easy way to implement this during the setup of the code. I found this code on the internet.
This works if I run this only. Then I can directly hear what i am saying. But I was not able to include this into the main code. Any idea?

My idea was that you hear an initial beep. Then you can test the microphone for e.g. 10-15 seconds. After this you hear another beep and the phone works as usual. So the test would not require to lift anything. Just streams the microphone data directly to the speaker for some seconds and thats it.

Can anyone help to include this or has a better idea?

// Advanced Microcontroller-based Audio Workshop
//
// http://www.pjrc.com/store/audio_tutorial_kit.html
// https://hackaday.io/project/8292-microcontroller-audio-workshop-had-supercon-2015
//
// Part 2-4: Using The Microphone

///////////////////////////////////
#include <Audio.h>
#include <Wire.h>
#include <SPI.h>
#include <SD.h>
#include <SerialFlash.h>

// GUItool: begin automatically generated code
AudioInputI2S i2s1; //xy=410.00000762939453,211.00000286102295
AudioOutputI2S i2s2; //xy=663.0000076293945,263.00000381469727
AudioConnection patchCord1(i2s1, 0, i2s2, 0);
AudioConnection patchCord2(i2s1, 0, i2s2, 1);
AudioControlSGTL5000 sgtl5000_1;
// GUItool: end automatically generated code

///////////////////////////////////

void setup() {
Serial.begin(9600);
AudioMemory(8);
sgtl5000_1.enable();
sgtl5000_1.volume(0.5);
sgtl5000_1.inputSelect(AUDIO_INPUT_MIC);
sgtl5000_1.micGain(36);
delay(1000);
}

void loop() {
// do nothing
}

issue with volume levels

Hi, so on my phone, using the original code that used RAW files, the volume levels for playback are fine. With the new version, that uses WAV files, which I am excited to use, the playback volumes are very low.

I try to turn the sgtl5000_1.volume(0.85) higher than 0.85 and the playback is distorted.

I try to turn the mixer gain on the wav playback channel higher, and it also gets distorted.
mixer.gain(1, 1.0f);

Any ideas why this is different? I suspect the file format is the difference, but I don't know how to get around it. Thanks.

Clarify recording wav files saving to SD card

Have one of the fork versions (DD4WH) of this code working seemingly fine.

One main question I have related to the saving of the recording wav files to the SD card...
-I have been testing my audio guestbook while connected to my PC for now.
-It seems that the recordings don't save to my SD card right away. I have the SD card open while operating so I can watch this.
-They do seem to be saving to memory because I can play them back on the phone after recording.
-Once I disconnect the phone from the PC and reconnect it, then the files that were recorded prior appear on the SD card as viewed from the PC.

Is this expected behavior, or should the files be visible as saved on the SD card in relatively real time?

Error compiling for board Teensy 4.0 SerialFlash.h

Arduino: 1.8.19 (Windows 10), TD: 1.57, Board: "Teensy 4.0, Serial + MTP Disk (Experimental), 600 MHz, Faster, US English"

In file included from C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Audio/Audio.h:129:0,

Multiple libraries were found for "SD.h"

             from C:\Users\user\Desktop\audio-guestbook\audio-guestbook.ino:25:

Used: C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\SD

Not used: C:\Program Files (x86)\Arduino\libraries\SD

C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Audio/play_serialflash_raw.h:33:25: fatal error: SerialFlash.h: No such file or directory

compilation terminated.

Error compiling for board Teensy 4.0.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

Crack noise while speaking

Hi all,

I really appreciate that you created that code & video to rebuild this fantastic idea. Unfortunately I am currently struggeling with one issue. Everything works fine except of some cracking noises when I speak. First I thought this is caused by the old microphone capsules but I changed it and it is still there.
00033.zip

I uploaded a test recording. In this case there are not many crack noises, sometimes it is worse. But after 13 seconds you can hear it.
And it only occurs when I am speaking. When I don't say anything it is all clear.

Here is a list what I already tried:

  • Checked all soldering points
  • Exchanged AUX cable to a double shielded
  • Used a ground loop isolator
  • Changed old microphone to a AOL5024 L HD R
  • Increased the audio buffer from 60 to 125 (using a SanDisk 32 GB sd card with class 10 - should be fast enough)
  • added some foam in front of the microphone cause I thought maybe that is caused by air exhaust while talking

Now I really have no further idea what to do. The strange thing is that I have the same issue with another telephone which has the exact same setup. So I built two of these with the same hardware and now have the same issue with both.

I would really appreciate if you have further tipps for me. I really would like to have a more crystal clear sound.

Big thanks in advance!
Dominik

Error in Arduino IDE after compiling

Hello,

i have a problem after compiling your code, i use the 4.1 with the Audioshield. Can you help me somehow?

Arduino IDE 2.0.2
MPT_Teensy: https://github.com/KurtE/MTP_Teensy (the same error with the original)

This is what i got:

c:\Users\xxxxxxxxx\Privat\Dokumente\Arduino\libraries\MTP_Teensy-main\src\MTP_Teensy.cpp: In member function 'uint32_t MTP_class::GetObjectInfo(MTP_class::MTPContainer&)':
c:\Users\xxxxxxxx\Dokumente\Arduino\libraries\MTP_Teensy-main\src\MTP_Teensy.cpp:523:34: warning: unknown option after '#pragma GCC diagnostic' kind [-Wpragmas]
   #pragma GCC diagnostic ignored "-Wformat-truncation" /* Or "-Wformat-truncation" */
                                  ^
Opening Teensy Loader...
Memory Usage on Teensy 4.1:
  FLASH: code:110912, data:14636, headers:8592   free for files:7992324
   RAM1: variables:19264, code:107352, padding:23720   free for local variables:373952
   RAM2: variables:45440  free for malloc/new:478848

Unable to access SD card

Serial set up correctly
Mode switched to: Initialising
Button (pin 1) Release
Unable to access the SD card
Unable to access the SD card
Unable to access the SD card
Unable to access the SD card
Unable to access the SD card

i do not currently have a switch for the playback feature but no matter what sd card i use i am unable to access it. any help would be appreciated.

Erreur

Hello, I'm stuck on the program. I made the changes given in this link Several Problems AND SOLUTIONS I Found During My Build Issue #36 playfultechnology/audio-guestbook GitHub but I still find the following error C:\Program Files (x86)\Arduino\ arduino-builder -dump-prefs -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86 )\Arduino\hardware\tools\avr -built-in-libraries C:\Program Files (x86)\Arduino\libraries -fqbn=teensy:avr:teensy40:usb=mtp,speed=600,opt=o2std,keys= en-us,audiotune=bigger -ide-version=10819 -build-path C:\Users\meaux\AppData\Local\Temp\arduino_build_1208 -warnings=none -build-cache C:\Users\meaux\AppData\Local\ Temp\arduino_cache_312700 -verbose C:\Users\meaux\AppData\Local\Temp\Temp2_audio-guestbook-main.zip\audio-guestbook-main\audio-guestbook\audio-guestbook.ino C:\Program Files (x86)\ Arduino\arduino-builder -compile -logger=machine -hardware C:\Program Files (x86)\Arduino\hardw are -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -built-in-libraries C:\Program Files (x86)\ Arduino\libraries -fqbn=teensy:avr:teensy40:usb=mtp,speed=600,opt=o2std,keys=fr-fr,audiotune=bigger -ide-version=10819 -build-path C:\Users\meaux\ AppData\Local\Temp\arduino_build_1208 -warnings=none -build-cache C:\Users\meaux\AppData\Local\Temp\arduino_cache_312700 -verbose C:\Users\meaux\AppData\Local\Temp\Temp2_audio-guestbook-main. zip\audio-guestbook-main\audio-guestbook\audio-guestbook.ino Using board 'teensy40' from platform in folder: C:\Program Files (x86)\Arduino\hardware\teensy\avr Using core 'teensy4' from platform in folder: C:\Program Files (x86)\Arduino\hardware\teensy\avr Detecting libraries used... "C:\Program Files (x86)\Arduino\hardware\teensy/.. /tools/ arm/bin/arm-none-eabi-g++” -E -CC -x c++ -w -g -Wall -ffunction-sections -fdata-sections -nostdlib -std=gnu++14 -fno-exceptions -fpermissive -fno -rtti -fno-th readsafe-statics -felide-constructors -Wno-error=narrowing -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -D__IMXRT1062__ -DTEENSYDUINO=157 -DARDUINO=10819 -DARDUINO_TEENSY40 -DF_CPU=600000000 - DUSB_MTPDISK -DLAYOUT_ENGLISH "-IC:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4" ""C:\Users\meaux\AppData\Local \Temp\arduino_build_1208\sketch\audio-guestbook.ino.cpp"" -o "null" exec: "C:\Program Files (x86)\Arduino\hardware\teensy/../ tools/arm/bin/arm-none-eabi-g++” -E -CC -x c++ -w -g -Wall -ffunction-sections -fdata-sections -nostdlib -std=gnu++14 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -D__IMXRT1062__ -DTEENSYDUINO=157 -DARDUINO=10819 -DARDUINO_TEENSY40 -DF_CPU=600000000 -DUSB_MTPDISK -DLAYOUT_FRENCH "-IC:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4": file does not exist Compilation error po on the Teensy 4.0 image.png map The play files are tabbed. I don't understand why she file doesn't exist. I need help please.

So close! probably an easy solution - hook switch is reversed

after great stress, my phone is nearly all together and working.
my only problem is the phone hook activates the wrong way round - so its recording if I'm hanging the phone up.
is there an easy bit in the code to switch this around? or is a hardware issue I need to go back in and sort.

its a GPO746 phone is anyone can help!

great project too! really enjoyed learning a little of code. thanks!

Why?

C:\Users\brand\OneDrive\Documents\Arduino\sketch_feb12a\sketch_feb12a.ino:30:24: fatal error: MTP_Teensy.h: No such file or directory
compilation terminated.
Multiple libraries were found for "SD.h"
Used: C:\Users\brand\AppData\Local\Arduino15\packages\teensy\hardware\avr\1.57.2\libraries\SD
Not used: C:\Users\brand\AppData\Local\Arduino15\libraries\SD
exit status 1

Compilation error: MTP_Teensy.h: No such file or directory

Nothing happens after uploading to Teensy

I was finally able to get all the way through the sketching and uploading. I have a file named Greeting.wav on the sd card, but when I pick up the phone, nothing happens. I have the Teensy 4.0, and the Audio Shield version C. Should the led on the teensy blink while the program is running? Is there a way I can check to see if the teensy and the audio shield are working together correctly? I only have 2 weeks left before we leave for our wedding so I'm hoping I can get this to work before then.

MTP_Teensy.h

I've read through everything I can find and have downloaded the mtp with the green code button on the site, https://github.com/KurtE/MTP_Teensy I've unzipped it and put in in to programfiles(86): Arduino: libraries then selected serial +MTP Disk. But it comes up with this error?
not really sure what I've missed?
Screenshot 2023-01-31 195939

Lost Connection with Teensy 4.0

Hello

When I connect my audio shield rev D to my Teensy 4.0 to monitor the program, I lost the connection with my Teensy on my computer.

Do you have any issue please?

Xavier

Find Arduino architecture configuration files on MAC

Installation method

Unfortunately, "installation" is a bit messy, but you only have to do it once (unless you update your Arduino IDE or Teensyduino). The guestbook sketch folder contains two Arduino architecture configuration files, boards.local.txt andplatform.txt. These must be used to update your existing configuration files; in Windows systems these will typically be in C:\Program Files (x86)\Arduino\hardware\teensy\avr [todo: where are they on Linux and Mac?].

-> These Files are hidden within the Arduino.app/Teensyduino.app-Packages.
Do a right click and chose inspect package content. There you wll find the files in the Java folder.

Unable to access the SD card

After compiling and uploading the code successfully my board doesn't do anything when hooked up to the phone. Naturally I plugged it in and ran the serial monitor to see if I could troubleshoot. The monitor continuously prints the message

"Unable to access the SD card"

I have the SD card slotted directly onto the audio shield's card slot. I verified the SD card compatibility as well so I'm not sure if this is a code error or a hardware issue. Any help is appreciated!

"Not declared in this scope"

I am running into issues compiling for my teensyLC and get the two below errors. I am very novice so any assistance would be helpful, thank you!
Capture

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.