EngineersGarage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise
You are here: Home / Topics / Need urgent help

Need urgent help

|

Microcontroller › Arduino › Need urgent help

  • This topic has 0 replies, 1 voice, and was last updated 8 years, 11 months ago by arduino.
Viewing 1 post (of 1 total)
  • Author
    Posts
  • July 20, 2016 at 10:06 am #4528
    arduino
    Participant

    Hii all,

    I want to play the samples continuosly without opening the sd card everytime. That means I want to play the samples from the buffer. I played samples continously but everytime I am opening the sd card. How to play
    the samples from buffer?. Please find the attachment of the code. 

     


    boolean buffill()
        {
          boolean ret = false;
          if (play)
          {

            // The buffer must be filled only if the previous buffer was finished to be read

            ret = true;
            // If we the sample read has arrived to the end of the file, we must 
              
    stop the sample reading

            if (possample >= (endofsample – bufsize))
            {
              closefile = true;

            }

            // OPEN FILE
            if (openfile)
            {
              myFile = SD.open(samplen, O_READ);
              size_t length1 =  myFile.read(&header, sizeof(header));       
              endofsample = header.chunk_size – bufsize;
              length1 = myFile.read(buf, sizeof(buf));
              possample = length1 + sizeof(header);
              openfile = false;
            }
            else
            {
              // CLOSE FILE
              myFile.close();
              play = false;

             }

          }
              return ret;

        }

  • Author
    Posts
Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.
Log In

RSS Recent Posts

  • Help with finding unique wire lug(s) June 21, 2025
  • Simple LED Analog Clock Idea June 21, 2025
  • Kawai KDP 80 Electronic Piano Dead June 21, 2025
  • Saga 1400sv vinyl cutter motherboard issue June 21, 2025
  • using a RTC in SF basic June 20, 2025

Stay Up To Date

Newsletter Signup
EngineersGarage

Copyright © 2025 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy | Advertising | About Us

Search Engineers Garage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise