Forum Rule: Always post complete source code & details to reproduce any issue!
Page 12 of 12 FirstFirst ... 2 10 11 12
Results 276 to 292 of 292

Thread: Teensy 4.0 - based Audio Guestbook

  1. #276
    Senior Member BriComp's Avatar
    Join Date
    Apr 2014
    Location
    Cheltenham, UK
    Posts
    1,141
    I don't know where you are, you have not put that information in when you registered for the PJRC forum, but the Adaptor card can be bought here for worldwide shipment.

  2. #277
    Junior Member
    Join Date
    Feb 2023
    Posts
    18
    Hey, so i used my phone at a wedding for the 1st time last night, despite the issues i was having. everything worked pretty will. only a few things i have issues with. 1 is my original problem where after i playback last message and hang up, it switches to recording mode instead of back to ready. 2nd thing i had a problem with last night was if someone listens picks up the phone but hangs up before the greeting ends, it won't go back to ready mode, so upon hang up, it will continue to record until someone else picks up the phone. which brings me to the 3rd thing, is there a way to limit recording size, lets say to 1 minute and it will automatically end the recording and go into ready mode with the phone in hand, AND STAY in ready mode when the phone is hung up? keep in mind, when i have the phone plugged into my laptop, issues 1 and 2 don't exit, the phone behaves properly. can anyone offer any insight?

  3. #278
    Junior Member
    Join Date
    Mar 2023
    Posts
    4
    Quote Originally Posted by mille81 View Post
    Hi together, I'm trying to get this running...
    I have a Teensy 3.6 (4.0/4.1 was not in stock...) with the audio shield.
    I downloaded DD4WH´s code and tried to compile as said in the documentation, but I still get this error message:
    Code:
    In file included from C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Audio/Audio.h:129:0,
                     from C:\Users\Admin\Documents\audio-guestbook-main\audio-guestbook\audio-guestbook.ino:32:
    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.
    Fehler beim Kompilieren für das Board Teensy 3.6.
    How can I Solve this? I installed everything like it's in the documentation.
    Hello,

    I was the same problem.

    I find the missing data in this website. https://github.com/PaulStoffregen/

    All is good after.

  4. #279
    Junior Member
    Join Date
    Dec 2022
    Posts
    5
    Quote Originally Posted by svperman View Post
    I badly need help. I followed all the steps and connected everything. Copy pasted the code (removed Teensy 4.1 part as I am using 4.0), compiled successfully, then nothing. Not even a beep.

    Checked the serial monitor and it says "Unable to access the SD card" repeatedly. I understand that this is a printed message to check if there is an SD card. I don't know why it is stuck in this loop.

    To check my SD Card, i ran File > Examples > MTP_Teensy > Simplified Examples. My SD card got detected but 0 gb. Not sure if this is purely an SD card problem but at least I should hear a beep, correct?
    I have the same problem. Wiring and Pin Settings are correct. Any idea how to fix this? Teensy 4.0 with rev d Audio shield

  5. #280
    Junior Member
    Join Date
    Mar 2023
    Posts
    4
    Quote Originally Posted by mille81 View Post
    I have the same problem. Wiring and Pin Settings are correct. Any idea how to fix this? Teensy 4.0 with rev d Audio shield
    Same problem too.

    I use teensy 4.0 with audio shield REV D2. I changed too mi SD PIN to 10, 11,13 but the it's the same.

    I have this line when I compile. I don't know what is it.

    /Users/Jeff/Documents/Teensyduino/libraries/MTP_Teensy-main/src/MTP_Teensy.cpp: In member function 'uint32_t MTP_class::GetObjectInfo(MTP_class::MTPContainer&) ':
    /Users/Jeff/Documents/Teensyduino/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" */

  6. #281
    Junior Member
    Join Date
    Mar 2023
    Posts
    4
    Quote Originally Posted by Jefff34 View Post
    Hello,

    I was the same problem.

    I find the missing data in this website. https://github.com/PaulStoffregen/

    All is good after.
    Quote Originally Posted by Jefff34 View Post
    Same problem too.

    I use teensy 4.0 with audio shield REV D2. I changed too mi SD PIN to 10, 11,13 but the it's the same.

    I have this line when I compile. I don't know what is it.

    /Users/Jeff/Documents/Teensyduino/libraries/MTP_Teensy-main/src/MTP_Teensy.cpp: In member function 'uint32_t MTP_class::GetObjectInfo(MTP_class::MTPContainer&) ':
    /Users/Jeff/Documents/Teensyduino/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" */
    Edit: My problem was bad connexion all is ok now with my SD card. I have a problem with a bad audio quality with the micro but I will test other cable or soldering...

  7. #282
    Junior Member
    Join Date
    Mar 2023
    Posts
    4
    thank you for the hint. I have purchased now. Will do my first tests once all parts arrived.

  8. #283
    Junior Member
    Join Date
    Mar 2023
    Posts
    4
    Hi, again. Finally get the guestbook working thank you all in sharing your knowledge. I have some background noise in the audio recording from the original microphone. Seems there are some interferences in the cable. Does anybody has some recommendation how to fix it? Attached is a sample recorded directly on the phone. i have tried to keep the wires short as possible. I have soldered the pins to MIC and GND and attached with regular pin connector. Please see picture attached.
    1. Will a new capsule microphone: https://www.reichelt.com/de/en/elect...t=pol_12&nbc=1
    2. Or do i have messed something up with the wiring?

    I get the same background noise when i power the teensy with an external power bank. Also i have removed a metal plate on the bottom of the phone.
    Thank you.

    Click image for larger version. 

Name:	IMG_7706.jpg 
Views:	9 
Size:	172.9 KB 
ID:	30734
    Click image for larger version. 

Name:	IMG_7707.jpg 
Views:	6 
Size:	111.7 KB 
ID:	30735
    Click image for larger version. 

Name:	IMG_7708.jpg 
Views:	9 
Size:	177.0 KB 
ID:	30736
    greeting.zip
    Last edited by StefanM.; 03-26-2023 at 03:32 PM.

  9. #284
    Senior Member h4yn0nnym0u5e's Avatar
    Join Date
    Apr 2021
    Location
    Cambridgeshire, UK
    Posts
    630
    That sample is incredibly quiet, so I'm not surprised the noise level is high. From your third image it looks as if you have the mic ground (black wire) connected to the mic input of the audio card ... though of course, as you don't show the other end, that could be wired backwards too, which would cancel the problem out.

    As it's so cheap, it seems a reasonable chance to take to try a different microphone. If it works, do report back.

  10. #285
    Junior Member
    Join Date
    Mar 2023
    Posts
    4
    Quote Originally Posted by h4yn0nnym0u5e View Post
    That sample is incredibly quiet, so I'm not surprised the noise level is high. From your third image it looks as if you have the mic ground (black wire) connected to the mic input of the audio card ... though of course, as you don't show the other end, that could be wired backwards too, which would cancel the problem out.

    As it's so cheap, it seems a reasonable chance to take to try a different microphone. If it works, do report back.
    Thanks for coming back to me... I have already tried to switch the black and yellow wires. Unfortunately without look. Still bad audio. If i increase the volume, the background noise seems to be louder as well. I will give it a try again later today to pump up the volume. I will purchase a microphone to check if the result will be better. Will report the result asap.

  11. #286
    Senior Member h4yn0nnym0u5e's Avatar
    Join Date
    Apr 2021
    Location
    Cambridgeshire, UK
    Posts
    630
    Quote Originally Posted by StefanM. View Post
    If i increase the volume, the background noise seems to be louder as well.
    This isn't very surprising ... if you record a quiet signal with a lot of noise, turning the volume up will just turn the noise up along with the signal. You need to get a better signal into the WAV file.

    I just looked at the audio library code, and the mic gain defaults to +52dB. It is possible to increase this to +63db, if you put in a line sgtl5000_1.micGain(63); - this must be after sgtl5000_1.inputSelect(AUDIO_INPUT_MIC);. It will at least make your WAV file louder, though it may be just as noisy - from your images, the mic wires are neither twisted together nor shielded. You could try removing the capsule from the phone and connecting it directly to the audio adaptor with very short wires, which would probably reduce noise though it won't boost the signal.

  12. #287
    Junior Member
    Join Date
    Mar 2023
    Posts
    4
    Hi everybody,

    I have a problem with my audio guestbook with bad record with my micro.
    I test code of DD4WH and there is issus with record. I test code of playfull and all is OK with record. So, I think the MTP during records is the source of my problem.

    I am newby in code. I woulds like to keep the code of DD4WH because I can record greeting wav directly to the phone, but I would like add MTP disable during record.

    Do you know how I will do?

    If I add this line "MTP.storage()->set_DeltaDeviceCheckTimeMS((uint32_t) -1);" is enough or it's more difficult.

    Other solution, integrated auto greeting Wave code in the code of playfull.
    One person have made that!

    Thank you very much.

    Have a good day.

    Jeff

  13. #288
    Senior Member h4yn0nnym0u5e's Avatar
    Join Date
    Apr 2021
    Location
    Cambridgeshire, UK
    Posts
    630
    Quote Originally Posted by Jefff34 View Post
    So, I think the MTP during records is the source of my problem.

    I am newby in code. I woulds like to keep the code of DD4WH because I can record greeting wav directly to the phone, but I would like add MTP disable during record.

    Do you know how I will do?

    If I add this line "MTP.storage()->set_DeltaDeviceCheckTimeMS((uint32_t) -1);" is enough or it's more difficult.
    It's not quite as simple as that, unfortunately. Here's a selection of the MTP enable / disable code, as found in the original repository:
    Code:
    uint32_t MTPcheckInterval; // default value of device check interval [ms]
    
    ...
    
    void setup() {
    
    ...
    
      // mandatory to begin the MTP session.
        MTP.begin();
    
      // Add 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();
    
    ...
    
    }
    
    ...
    
    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");
    }
      
    ...
    
    void startRecording() {
      setMTPdeviceChecks(false); // disable MTP device checks while recording
    
    ...
    
    }
    
    ...
    
    void stopRecording() {
    
    ...
    
      setMTPdeviceChecks(true); // enable MTP device checks, recording is finished
    }
    Key points to note:
    • create storage for the MTP check interval
    • in setup(), find the default value for the MTP check interval
    • before recording starts, disable MTP checks (set interval to -1)
    • after recording finishes, restore checks by setting interval back to the default

    I can't be 100% sure that's complete, but it's the main idea. Take a look at the changes made in PR#20 if anything doesn't work.

    Unrelated to the MTP issue, but worth noting, is that DD4WH's generation of the WAV chunks is incorrect, which is also fixed in the original repository - look at the calculations of the Subchunk2Size and ChunkSize values. Not every application shows a visible error, but it could be that some will appear to play the files but actually emit no audio. Groove Music and Windows Media Player play without complaining, but GoldWave gives two warnings before it'll load such a file.

  14. #289
    Senior Member DD4WH's Avatar
    Join Date
    Oct 2015
    Location
    Central Europe
    Posts
    715
    Quote Originally Posted by h4yn0nnym0u5e View Post
    Unrelated to the MTP issue, but worth noting, is that DD4WH's generation of the WAV chunks is incorrect, which is also fixed in the original repository - look at the calculations of the Subchunk2Size and ChunkSize values. Not every application shows a visible error, but it could be that some will appear to play the files but actually emit no audio. Groove Music and Windows Media Player play without complaining, but GoldWave gives two warnings before it'll load such a file.
    Hmm, I cannot reproduce a problem in playing the WAV files recorded with my code, they play correctly and smoothly with different players on different devices.

    You may be right that the chunk lengths are inconsistent (I am not a specialist in WAV headers), but the files are playing and sound nicely . . .

    As you claim in various threads that there are issues with the code in my repo (which I cannot reproduce, because I built four Audio Guest Books with my code which function flawlessly and I have provided a very detailed Manual how to build the hardware and software !), I will now delete my repo in order for all those people interested in the Audio guest Book to have ONE consistent code source. I am sorry that my code and my manual in the Readme produced problems, but without reproducible issue descriptions, there is no way for me to offer any help. And just claiming that "it could be that some will [...] actually emit no audio" without reproducible facts is just blind guessing/fantasy . . . but from now on it will be easier, no more problems to choose between different code sources.

    Have fun with the Teensy !

  15. #290
    Junior Member
    Join Date
    Mar 2023
    Posts
    1
    So I am using a teensy 4.1 and the 4x audio sheild. I'm using the original code to program the board. The only change I made is to use a RAW greeting file instead of a wav file because the wav file playback was horrible. Over all it's working but I have run into a horrible issue. In which I haven't found a clear answer to. When ever it records the audio play back is just a buzzing noise nothing else. I do not get buzzing noise on the greetings just the recording. I've even removed the mic input to test and see if the recording would sound silent. Nope it's still buzzing. I've even changed the code to work off of the line in instead of the mic and nothing has changed. I've removed the old microphone and replaced it with a electret mic from Amazon still no audio just buzzing. I'm powering the teensy from a external battery pack. I've checked all of my soldering and wiring.... I do not know how to solve this issue. Could someone please help?

  16. #291
    Senior Member h4yn0nnym0u5e's Avatar
    Join Date
    Apr 2021
    Location
    Cambridgeshire, UK
    Posts
    630
    Quote Originally Posted by DD4WH View Post
    Hmm, I cannot reproduce a problem in playing the WAV files recorded with my code, they play correctly and smoothly with different players on different devices.

    You may be right that the chunk lengths are inconsistent (I am not a specialist in WAV headers), but the files are playing and sound nicely . . .

    As you claim in various threads that there are issues with the code in my repo (which I cannot reproduce, because I built four Audio Guest Books with my code which function flawlessly and I have provided a very detailed Manual how to build the hardware and software !), I will now delete my repo in order for all those people interested in the Audio guest Book to have ONE consistent code source. I am sorry that my code and my manual in the Readme produced problems, but without reproducible issue descriptions, there is no way for me to offer any help. And just claiming that "it could be that some will [...] actually emit no audio" without reproducible facts is just blind guessing/fantasy . . . but from now on it will be easier, no more problems to choose between different code sources.

    Have fun with the Teensy !
    I am right about the chunk lengths - here's the Goldwave error message:
    Click image for larger version. 

Name:	2023-03-27 18_16_03-GoldWave.png 
Views:	0 
Size:	9.9 KB 
ID:	30747
    As I also noted, I have players which play the resulting files without complaint; but I don't think it's totally unreasonable to say "it could be that some will [...] actually emit no audio" - "could be" means just that, and I don't have the resources to test every application on every OS and give an exhaustive list of those that fail. I don't actually think it's very likely that it's causing anyone problems, it seems far more probable that it's defective hardware, given the wording of most of the "I finally got it working" posts.

    As far as I can recall this is the only issue with your code I've mentioned in these forums. I would have reported it on your repo, but I couldn't because that option isn't available to me. I'm not a specialist in the WAV file format either, but when I had to create code to read and write WAV files I did the research and tested the results (where Goldwave came in really handy, as it was the only application I have that spots the problems).

    Up to you whether you pull your repo. I think it has some really good features that builders seem to want, so it'd be a much more popular result to fix the chunk lengths. I've been waiting for my latest PR to be adopted into the upstream repo, and was then going to see if I could fairly simply merge your features and documentation, but it looks like the author has lost interest in supporting it That's just another blind guess...

  17. #292
    Senior Member h4yn0nnym0u5e's Avatar
    Join Date
    Apr 2021
    Location
    Cambridgeshire, UK
    Posts
    630
    Quote Originally Posted by h4yn0nnym0u5e View Post
    This isn't very surprising ... if you record a quiet signal with a lot of noise, turning the volume up will just turn the noise up along with the signal. You need to get a better signal into the WAV file.

    I just looked at the audio library code, and the mic gain defaults to +52dB. It is possible to increase this to +63db, if you put in a line sgtl5000_1.micGain(63); - this must be after sgtl5000_1.inputSelect(AUDIO_INPUT_MIC);. It will at least make your WAV file louder, though it may be just as noisy - from your images, the mic wires are neither twisted together nor shielded. You could try removing the capsule from the phone and connecting it directly to the audio adaptor with very short wires, which would probably reduce noise though it won't boost the signal.
    Update: as noted on another thread, there's already a call to sgtl5000_1.micGain(); in the code, which typically sets the gain very low (somewhere between +5 and +15dB, depending on which repo you start from). This is very low, so more level can be achieved for sure - the default is +52dB, and you can set between 0 and +63. However, depending on your hardware quality, and in particular the shielding of the mic cable, you may just get a louder and very noisy WAV file. But at least it won't be an apparently flatline piece of audio that you can't hear at all...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •