Highlighted
Collaborator
  • 13
  • 17
  • 0
Registered since

Jul 7, 2019

Digging into the Sleepbuds audio format - it's not complicated, please let us create our own sounds!

I've done some digging into the audio format that the sleepbuds use. The design choices seem strange to me, in that the audio files the buds store for playback are uncompressed digital audio, which uses up more storage space, but less processor power than compressed audio. I suppose storage in the Sleepbuds is cheaper and easier than more processor power, which would impact on battery life.

 

It also seems strange to me that they are 24-bit audio, which again increases the storage requirements in the devices. For something that's played quietly, 16-bit should have been more than sufficient. Further to this, even though they are uncompressed, high-resolution audio, the sample rate is only 8 kHz (8,192 Hz to be exact, which is a power of 2 but not the more commonly used 8,000 Hz).

 

As a result of the low sample rate, the audio in the buds is limited to a frequency response of just 4kHz (or 4,000 Hz). Human hearing is ideally 20 Hz (deep, earth shaking bass) all the way up to 20kHz (20,000 Hz) although to be fair, not many people can hear this high.

 

I'm sure there were valid reasons for chosing an odd format like this - however dropping the resolution from 24-bit to 16-bit would have no audible impact (expecially given the sample rate) and make the audio files 2/3 the size.

 

I did read elswehere on this forum that one of the reasons given for not letting us make our own audio was that the files were EQ'd especially for the sound profile of the Sleepbuds.

 

Opening up the audio and comparing it to the full uncompressed waveforms (which are what you listen to for the preview on your phone) shows this to not be the case. The sound is the same (or at least very, very similar for all sounds below 4kHz) from the preview audio (which is an uncompressed 44.1Khz, or 48kHz, 32-bit WAV file)

 

I appreciate that creating custom sounds could be quite technically involved, and that Bose probably doesn't want to be responsible for supporting people who aren't familiar with a digital audio workflow. For those that have the technical capabilities however, there is so much more we can do with these devices.

 

We can make sound loops that are longer than 30-40 seconds. We can record environmental sounds that we want to sleep to and find more comforting.

 

I only need one sound to go to sleep to, I don't need a library of 10 different sounds in the buds. If I could have a single loop of, say, 3-5 minutes rather than 10 sounds each 30 seconds long, then I'd be far less able to detect loop points (and once I've heard a loop point, I can not unhear it - that sound is ruined for me to sleep to). If I could upload my own sounds, I'd go down to the coast for a night and record some of my own seaside night sounds. Gentle wind, surf breaking on the beach, a thunderstorm with some rolling thunder...

 

Please take this into conisderation - we have all put down a significant amount of money on a luxury item that has so much more capabilities than the current software allows for. I appreciate this is quite a niche market - there aren't many people who can justify spending hundreds of dollars on fancy ear plugs, but for those who have invested in this technology, please let us do more with it.

5 REPLIES 5
Highlighted
Moderator

Re: Digging into the Sleepbuds audio format - it's not complicated, please let us create our own ...

Hi Kaiserh, 

 

Thanks for posting and providing us with this feedback 

 

I will pass this onto our development team and appreciate the time that you have taken to make this post. 

 

Kind Regards, 

Hector B - Community Support 

Feel more. Do more. Be more.
New to the community? Check out our Community Guidelines and How to use the Bose Community for helpful hints on getting started. And don't forget to check out our new and improved Community Ranks and Rewards!
Highlighted
Participant
  • 3
  • 2
  • 0
Registered since

Sep 2, 2019

Re: Digging into the Sleepbuds audio format - it's not complicated, please let us create our own ...

Thank you for this valuable information. I've tried importing the samples in Audacity with the settings you suggested and the sound is recognizable but it's not quite there, it seems to me. Maybe I need to tweak something.

 

Anyway, regarding the possibility to load our own sounds, I've digged into the app files and found that the sounds are defined in the sound-production.json file. There are snippets like this:

 

"uploadable_sound": {
  "sleepbuds_left": {
    "url": "https://downloads.bose.com/eb/drowsy/iOS-Production/Sound%20Library/Campfire/Upload/Campfire-Left.bin",
    "file_size_in_bytes": 427296
  },
...
 
(this is for the Campfire sound).
 
In order to modify the json we should also re-sign the app, which in iOS involves having a Developer account.
I have it and it should be no great hassle, but there is a better way: change the DNS settings in my router, point
the hostname "download.bose.com" to my own server, replicate that path and put there the files to load into the Sleepbuds.
 
I'll try this as soon as I can and let you know. But I keep hoping that Bose will open this function in the app. Please notice the lenghts we are ready to go in order to have our own customized sounds!
Highlighted
Collaborator
  • 13
  • 17
  • 0
Registered since

Jul 7, 2019

Re: Digging into the Sleepbuds audio format - it's not complicated, please let us create our own ...

Here's some more info that I've documented on my blog:

 

https://automatica.com.au/2019/07/hacking-the-bose-sleepbuds/

https://automatica.com.au/2019/07/bose-sleepbuds-file-format-specifications/

 

I pulled apart the Android app and modified the json file and re-built the app. I normally use iOS but I thought it might be easier to pull apart, and put back together again, the Android app.

 

When I rebuilt the app and sideloaded it onto my Android device, the new entried that I'd added to the file didn't appear in the list.

 

The file I modified is in res/raw/sound_android_1_0_0.json

 

I have created some noise samples - Brown Noise, Grey Noise, Pink Noise and White Noise and added all the other assets that are delivered along with the sound samples - here they are on Dropbox:

https://www.dropbox.com/sh/orejo0ecdqh9s8w/AAAv-Z-q4Pkcv19XwA_88Q1na?dl=0

 

There is the preview wav file, the left and right raw .bin files and all the thumbnails and poster images in the various formats that the Android app uses.

 

Here's a snippet of the .json file (at the end of this post) where I've attempted to put my own file in. Instead of trying to spoof the Bose servers (and dealing with potential https certificate mismatches) I uploaded them to my web server. I've replaced my server name with example.com in the snippet.

 

I'm willing to work with someone to get this going.

 

Bose, please do take note - we are desparate for more functionality from this device and we're willing to go to great lengths to facilitate it.

 

    {
      "ordinal": 20,
        "created": "2019-07-10T09:08:00.000Z",
        "updated": "2019-07-10T09:08:00.000Z",
        "version": "1.0.0",
        "author": "Automatica",
        "type_id": [1],
        "category_id": [1],
        "tag_ids": [1, 2],
        "group_id": [1],
        "thumbnail_image": {
          "default": "https://example.com/drowsy/Brown%20Noise_Thumbnail@hdpi.jpg",
          "mdpi": "https://example.com/drowsy/Brown%20Noise_Thumbnail@mdpi.jpg",
          "hdpi": "https://example.com/drowsy/Brown%20Noise_Thumbnail@hdpi.jpg",
          "xhdpi": "https://example.com/drowsy/Brown%20Noise_Thumbnail@xdpi.jpg",
          "xxhdpi": "https://example.com/drowsy/Brown%20Noise_Thumbnail@xxdpi.jpg",
          "xxxhdpi": "https://example.com/drowsy/Brown%20Noise_Thumbnail@xxxdpi.jpg"
        },
        "full_image": {
          "default": "https://example.com/drowsy/Brown%20Noise_Carousel_Image@hdpi.jpg",
          "mdpi": "https://example.com/drowsy/Brown%20Noise_Carousel_Image@mdpi.jpg",
          "hdpi": "https://example.com/drowsy/Brown%20Noise_Carousel_Image@hdpi.jpg",
          "xhdpi": "https://example.com/drowsy/Brown%20Noise_Carousel_Image@xdpi.jpg",
          "xxhdpi": "https://example.com/drowsy/Brown%20Noise_Carousel_Image@xxdpi.jpg",
          "xxxhdpi": "https://example.com/drowsy/Brown%20Noise_Carousel_Image@xxxdpi.jpg"
        },
        "full_image_blurred": {
          "default": "https://example.com/drowsy/Brown%20Noise_Carousel_Image_Blurred@hdpi.jpg",
          "mdpi": "https://example.com/drowsy/Brown%20Noise_Carousel_Image_Blurred@mdpi.jpg",
          "hdpi": "https://example.com/drowsy/Brown%20Noise_Carousel_Image_Blurred@hdpi.jpg",
          "xhdpi": "https://example.com/drowsy/Brown%20Noise_Carousel_Image_Blurred@xdpi.jpg",
          "xxhdpi": "https://example.com/drowsy/Brown%20Noise_Carousel_Image_Blurred@xxdpi.jpg",
          "xxxhdpi": "https://example.com/drowsy/Brown%20Noise_Carousel_Image_Blurred@xxxdpi.jpg"
        },
        "uploadable_sound": {
          "sleepbuds_left": {
            "url": "https://example.com/drowsy/Brown%20Noise-Left.bin",
            "file_size_in_bytes": 172032
          },
          "sleepbuds_right": {
            "url": "https://example.com/drowsy/Brown%20Noise-Left.bin",
            "file_size_in_bytes": 172032
          }
        },
        "preview_url": "https://example.com/drowsy/Brown%20Noise.wav",
        "identifier": 15482,
        "file_length_in_ms": 7000,
        "localized": {
          "title": {
            "da-DK": "Brunt støj",
            "cs-CZ": "Hluk Hluk",
            "el-GR": "Καφέ Θόρυβος",
            "de-DE": "Braunes Rauschen",
            "fi-FI": "Ruskea melu",
            "fr-FR": "Bruit marron",
            "hu-HU": "Barna zaj",
            "it-IT": "Rumore marrone",
            "ja-JP": "ブラウンノイズ",
            "ko-KR": "브라운 소음",
            "pl-PL": "Brązowy hałas",
            "nb-NO": "Brun støy",
            "nl-NL": "Bruine ruis",
            "ru-RU": "Коричневый шум",
            "sv-SE": "Vindpinad",
            "zh-CN": "布朗噪音",
            "en": "Brown Noise"
          }
        }
    },

 

 

Highlighted
Participant
  • 3
  • 2
  • 0
Registered since

Sep 2, 2019

Re: Digging into the Sleepbuds audio format - it's not complicated, please let us create our own ...

You really made some progress! You're right about certificates, I did not notice the "https" in the URL. So the only way is to modify the json file. In iOS without jailbreak it is harder, but doable.

 

You say that the new entries you added did not appear in the app. Maybe the number of sounds is hard-coded to 20... have you already tried to just replace one of the sounds and/or descriptions with your own, without touching anything else, just to be sure that this is the file used by the app? I do not know about the Android version, but the iOS app has lots of json files: sound-coda, sound-debug, sound-efe, sound-qa, sound-production. The latter seems the most probable... I'm going to experiment as soon as I have some time and let you know. Thank you again for all the great info!

 

Highlighted
Participant
  • 1
  • 1
  • 0
Registered since

May 26, 2020

Re: Digging into the Sleepbuds audio format - it's not complicated, please let us create our own ...

Bose, now that the Sleepbuds have been "retired", is there a plan to open source some SDK, share some specifications, or anything else to help power users like us get more value out of our Sleepbuds? 🙂

 

@kaiserh@federicof, thank you so much for sharing your findings so far! 🤗

Any new progress to report?