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.
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? |
|
@linguini1 the reason for nxstyle is to have the same style in the codebase. Ignoring files is the opposite of that. |
Yes, but would be very useful for 3rd party code. |
|
@cederom So far, we've been using the approach of downloading external dependencies, especially in apps. Introducing another approach when other places are using a different approach is the worst possible solution. Is this code MIT or Apache? If it is MIT, it can't be added to this repo without proper relicensing. |
|
@linguini1 this is an obvious violation of INVIOLABLES.md |
Ah, I guess downloading (or reformatting) is the only way. |
Add a simple library for parsing Ring Tone Text Transfer Language (RTTTL). Signed-off-by: Jiri Vlasak <jvlasak@elektroline.cz>
|
@raiden00pl I have reverted git clone to the Makefile. The rtttl-c is published under both, MIT or Apache-2.0 licenses. @cederom I have put very simple example in Kconfig already. I have put an example with printing frequencies and durations in the PR summary. The problem with an example that makes actual sound is that the board I am working on does not have a simple way to make a sound (like PWM) so I am not able to test it. When considering But please note that I am not able to test it, because I do not have cxd56xx. |
What is your problem and solution here @raiden00pl ? If this module wants to be better than existing examples/audio_rttl then let's make it better, not almost-the-same-but-better, and work together to make it happen. At this point both solutions looks almost the same except existing examples code does not fetch anyhing :-) My suggestions is for that solution to be different and better from existing audio_rttl example when it is well documented and anyone could use it out-of-the-box in under 1 minute on their own hardware :-) Or we can just add this as example/audio_rttl_2 not to complain too much? :-) |
Why not include tar.gz ?
What are solution:
I don't know if |
|
Hi @ghnotgood , the CMakeLists.txt files are missing; they are required to build with CMake |
Sounds good thank you @raiden00pl :-) Would it be possible to share the source code directly here and in format required by NuttX project @ghnotgood ? You can add what you have and we can try to add different use cases later on (i.e. PWM) :-) |
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.