Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Arduino IDE is unable to compile voice recorder code

Status
Not open for further replies.

Sashvat

Member
Hi guys, I got this code from GreatScott! Youtube channel to build an Arduino voice recorder (spy bug), I went to his instructables page and downloaded the code, I also downloaded the TMRpcm library and verified if everything is fine, but the IDE says- 'class TMRpcm' has no member named 'startRecording' for all cases. What should I do to fix this? Please let me know. Thank you
 

Attachments

  • SpyBug.ino
    2 KB · Views: 193
I hope that this is not too harsh, but I think that the long and short of it is that you have to do some homework to understand what that library is all about and how to uses it properly.

Here is a hint from the config.h file:


C:
//#define ENABLE_RECORDING
    // Amount of space to pre-allocate for recording
//    #define BLOCK_COUNT 10000UL  // 10000 = 500MB   2000 = 100MB

So, the IDE is telling you that the "command" ".startRecording" (the member of the class) does not exist. That seems to be saying pretty clearly that the code to record sound files and not just play them is not getting compiled.

That the code fragment that I included below is commented out gives you a clue as to what you need to do. BUT, do not think that I have solved the problem for you and it is now plug and play and all systems go for your spy activities.

I only gave a cursory glance at that library, but I would say that you need to spend the time to learn what the library does and how to use it. If you keep plowing away, I think that you can do that and there are many here that will help - if you put forth the effort. That is my opinion anyways.
 
I hope that this is not too harsh, but I think that the long and short of it is that you have to do some homework to understand what that library is all about and how to uses it properly.

Here is a hint from the config.h file:


C:
//#define ENABLE_RECORDING
    // Amount of space to pre-allocate for recording
//    #define BLOCK_COUNT 10000UL  // 10000 = 500MB   2000 = 100MB

So, the IDE is telling you that the "command" ".startRecording" (the member of the class) does not exist. That seems to be saying pretty clearly that the code to record sound files and not just play them is not getting compiled.

That the code fragment that I included below is commented out gives you a clue as to what you need to do. BUT, do not think that I have solved the problem for you and it is now plug and play and all systems go for your spy activities.

I only gave a cursory glance at that library, but I would say that you need to spend the time to learn what the library does and how to use it. If you keep plowing away, I think that you can do that and there are many here that will help - if you put forth the effort. That is my opinion anyways.
if someone has already written this and the code runs for them, whats the problem with mine?? it is the exact same as the way it is in YouTube. I checked the functions and advanced functions, and still unable to figure it out.
 
but to get a better clarity,

#define ENABLE_RECORDING
// Amount of space to pre-allocate for recording
#define BLOCK_COUNT 10000UL // 10000 = 500MB 2000 = 100MB

this basically gives a predefined space on the SD card to record the audio clip upto 500/100MB based on the BLOCK_COUNT value right?
 
I am sorry, but I can't simply give you a turn-key fix. I can't simply tell you, "do this" and now it will work just the way you want it to work.

I don't want to do the spying and don't want to spend a couple of hours going through the code and getting the hardware together and test out the library.

To get better clarity, you need to do those things. What I am trying to do is to give you a road map for going further.

So, take a step back. You get the error "TMRpcm' has no member named 'startRecording' " That means that your program wants to use a command that is not there - has not been compiled. Why is that and where is that command? So, take the time to go through all of the source code files and see what you can find out.

For instance, if you look through all of the files in the library, you will see one called Recording.ino and it is in a directory called "examples". Well, that would seem like something useful to look into. So go through that code and notice that at the top of the source code you can read helpful information...

Code:
Requirements:
Class 4 or 6 SD Card
Audio Input Device (Microphone, etc)
Arduino Uno,Nano, Mega, etc.
Steps:
1. Edit pcmConfig.h
    a: On Uno or non-mega boards, #define buffSize 128. May need to increase.
    b: Uncomment #define ENABLE_RECORDING and #define BLOCK_COUNT 10000UL
2. Usage is as below. See https://github.com/TMRh20/TMRpcm/wiki/Advanced-Features#wiki-recording-audio for
   additional informaiton.
Notes: Recording will not work in Multi Mode.

..and you read through all that and understand it and then try to run that example after you are sure that you have the hardware and so on and so forth.

Get what I am saying??

This is important because if you never figure out how to solve these problems, you will not have a good job that will pay enough to take care of old people like me..so pretty please...with sugar on top...spend the time to try and figure out what is going on and realize that it might take a while and you might have to stay after it.

Now, I have to go take a nap.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top