audioutils: Add RTTTL parsing library#3477
Conversation
|
@ghnotgood Please add "Signed-off-by" to your commit. Also add a simple message to the Commit Body, e.g. |
|
@lupyuen I am sorry, I forget again. Thank you. |
cederom
left a comment
There was a problem hiding this comment.
Thank you @ghnotgood :-)
- How this solution is differenf from nuttx-apps/examples/audio_rttl [1]? Why do you prefer this particular application?
- Did you test this solution on a real world hardware? Does it generate tones as intended? Can you please provide testing logs?
- The code is a tiny C and H file. There is no need to git clone it from external repo. Please add sources directly into the PR. When there is a new release of the upstream we will update it here too. NuttX aims to be self-contained and have least possible amount of external dependencies.
Add a simple library for parsing Ring Tone Text Transfer Language (RTTTL). Signed-off-by: Jiri Vlasak <jvlasak@elektroline.cz>
84840fe
The example is an example. I am not sure how to use the example to play a sound I want in my application -- there is no API in header file. Moreover, it looks like The proposed library, on the other hand, lets a develop define how to make a sound, which may be generic NuttX audio driver or any hacked board-specific solution.
Yes, as stated in the Testing section of this PR. The build log is: Running the The
I did it, but now the check fails due to formatting issues. |
I see, thank you @ghnotgood. In that case would it be possible to provide documentation with a working example please? Otherwise it looks just like this mentioned example :-)
Thank you, please add this example to the documentation, so other people could reply step by step. DAC seems a bit overkill here as simple square wave would do the job too right? Would it be possible to create examlpe for PWM too please? I would try to reply the PWM demo on one of my boards. That way we would have really easy to use solution :-)
Uh, I see, different syntax. Maybe we could just use tar.gz release package then and attach it here to the source base? It will be tiny too, easy to update, evade different code syntax, and most important avoid external downloads (github have fetch issues a lot). Does that sound good? :-) |
|
Is it not possible to make nxstyle ignore files? |
Summary
Add
rtttl-c, a simple parsing library, to theaudioutilsdirectory.Impact
Developers may implement a procedure that makes sound
and then play a sound encoded in the RTTTL string (
"..."in the following)Testing
The testing code is
with the output of
When instead of
print_tone, there is aplay_toneprocedure with the board-specific code to make the sound, the Jingle Bells song is played.