react-native-simple-note-pitch-detector 0.3.1 → 0.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -18,7 +18,7 @@ data class NoteAndDecibel(
18
18
  class PitchAnalyzer {
19
19
 
20
20
  private val notes = arrayOf("C","C#","D","D#","E","F","F#","G","G#","A","A#","B")
21
- private val notesBuffer = arrayOf(NoteAndDecibel(), NoteAndDecibel(), NoteAndDecibel(), NoteAndDecibel(), NoteAndDecibel())
21
+ private val notesBuffer = Array(6) { NoteAndDecibel() }
22
22
  private var counter = 0
23
23
 
24
24
  private lateinit var onChangePitch: (String) -> Unit
@@ -53,9 +53,9 @@ class PitchAnalyzer {
53
53
  if (counter == notesBuffer.size) {
54
54
  var s = ""
55
55
  for (noteAndDecibel in notesBuffer) {
56
- s += noteAndDecibel.note + " " + noteAndDecibel.decibel
56
+ s += noteAndDecibel.note + "*" + noteAndDecibel.decibel + ","
57
57
  }
58
- this.onChangePitch(s)
58
+ this.onChangePitch(s.substring(0, s.length - 1))
59
59
  counter = 0
60
60
  }
61
61
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-simple-note-pitch-detector",
3
- "version": "0.3.1",
3
+ "version": "0.3.3",
4
4
  "description": "a simple react native library to detect the pitch of the input recording",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",