# Playing flac files to Sonos

**URL:** https://forums.plex.tv/t/playing-flac-files-to-sonos/772783
**Category:** Plex Media Server
**Tags:** server-windows, sonos
**Created:** [January 25, 2022, 4:38am UTC](https://forums.plex.tv/t/playing-flac-files-to-sonos/772783 "2022-01-25T04:38:36Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![AgentWhite](https://avatars.discourse-cdn.com/v4/letter/a/71c47a/32.png) [@AgentWhite](https://forums.plex.tv/u/AgentWhite)
#### Post date: [January 25, 2022, 4:38am UTC](https://forums.plex.tv/t/playing-flac-files-to-sonos/772783/1 "2022-01-25T04:38:36Z")

</div>

Server Version#: 1.24.5.5173  
Player Version#: Sonos  
I have a bunch of .flac files that I’ve ripped from CD. When I try to play some of them through the Sonos app I receive an error saying connection to Plex was lost. Looking at the [PMS logs](https://support.plex.tv/articles/200250417-plex-media-server-log-files/) [Transcode] Streaming Resource: Bandwidth exceeded: 2147483647 kbps \> 32000 kbps

The 32000 kbps comes from my setting of 40mbps upload speed, but I can’t figure out why these new .flac files are showing such a weirdly high bandwidth. The same files play fine with PlexAmp and even play fine on the Sonos when I map my network drive directly as a Music Library.

I also see these errors if I turn on debug:  
Cannot direct play this item. Required bandwidth is not known and only kbps is available

---

<div class="post-metadata">

### Author: ![AgentWhite](https://avatars.discourse-cdn.com/v4/letter/a/71c47a/32.png) [@AgentWhite](https://forums.plex.tv/u/AgentWhite)
#### Post date: [January 25, 2022, 5:12am UTC](https://forums.plex.tv/t/playing-flac-files-to-sonos/772783/2 "2022-01-25T05:12:18Z")

</div>

I may have narrowed down the problem, but not sure why or how to fix. I tested with a file that works and a file that does not work. It seems the error for a file that does work says “Cannot direct play this item. Required bandwidth is not known and only kbps is available”

If I get info on the 2 files, I can see this XML tag in the file that works: requiredBandwidths=“691,691,691,691,691,691,691,691”

However that tag is missing in the file which does not work. I have no idea how or why that tag is missing on some of my flac files but I believe that is the cause of my problem. Any ideas where that metadata tag comes from?

---

<div class="post-metadata">

### Author: ![jjross](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/jjross/32/5936_2.png) [@jjross](https://forums.plex.tv/u/jjross)
#### Post date: [January 25, 2022, 6:06am UTC](https://forums.plex.tv/t/playing-flac-files-to-sonos/772783/3 "2022-01-25T06:06:14Z")

</div>

Can you try running a deep analysis on the file?

---

<div class="post-metadata">

### Author: ![AgentWhite](https://avatars.discourse-cdn.com/v4/letter/a/71c47a/32.png) [@AgentWhite](https://forums.plex.tv/u/AgentWhite)
#### Post date: [January 25, 2022, 5:21pm UTC](https://forums.plex.tv/t/playing-flac-files-to-sonos/772783/4 "2022-01-25T17:21:14Z")

</div>

I found a post which described the deep analysis, I wasn’t sure how to kick that off manually, however noticed that my scheduled tasks were set to run at 2AM. I checked this morning and the files now have requiredBandwidths metadata.

Here is a snippet of the before XML:

```auto
<Media id="394667" duration="681800" audioChannels="2" audioCodec="flac" container="flac">
<Part accessible="1" exists="1" id="427088" key="/library/parts/427088/1643086092/file.flac" duration="681800" file="\\TOWER\Media\Music\Pink Floyd\Animals (1977)\03 Pigs (Three Different Ones).flac" size="55455870" container="flac">
<Stream id="343926" streamType="2" selected="1" codec="flac" index="0" channels="2" bitrate="651" albumGain="1.96" albumPeak="0.648834" albumRange="9.359037" audioChannelLayout="stereo" bitDepth="16" endRamp="-42.61 0.10;-38.74 1.00;-29.91 6.40;-22.98 12.10;-20.95 15.60;-17.47 18.90;-14.73 19.60;-11.74 25.10;-8.86 31.20;-5.41 36.40;-2.98 45.40;0.25 123.90;" gain="1.96" loudness="-19.96" lra="9.36" peak="0.648834" samplingRate="44100" startRamp="-51.00 0.00;-36.47 0.20;-28.37 0.30;-23.56 0.40;-18.44 2.60;-17.49 2.70;-12.19 10.30;-11.30 10.40;-6.70 36.10;-4.84 36.20;-2.53 52.40;0.26 282.90;" displayTitle="FLAC (Stereo)" extendedDisplayTitle="FLAC (Stereo)"> </Stream>
<Stream id="343927" key="/library/streams/343927" streamType="4" codec="txt" format="txt" provider="com.plexapp.agents.lyricfind" displayTitle="TXT (External)" extendedDisplayTitle="TXT (External)"> </Stream>
</Part>

```

Same file with XML after deep analysis:

```auto
<Media id="394667" duration="681800" bitrate="651" audioChannels="2" audioCodec="flac" container="flac">
<Part accessible="1" exists="1" id="427088" key="/library/parts/427088/1643086092/file.flac" duration="681800" file="\\TOWER\Media\Music\Pink Floyd\Animals (1977)\03 Pigs (Three Different Ones).flac" size="55455870" container="flac" deepAnalysisVersion="6" requiredBandwidths="652,652,652,652,652,652,652,652">
<Stream id="343926" streamType="2" selected="1" codec="flac" index="0" channels="2" bitrate="651" albumGain="1.96" albumPeak="0.648834" albumRange="9.359037" audioChannelLayout="stereo" bitDepth="16" endRamp="-42.61 0.10;-38.74 1.00;-29.91 6.40;-22.98 12.10;-20.95 15.60;-17.47 18.90;-14.73 19.60;-11.74 25.10;-8.86 31.20;-5.41 36.40;-2.98 45.40;0.25 123.90;" gain="1.96" loudness="-19.96" lra="9.36" peak="0.648834" requiredBandwidths="652,652,652,652,652,652,652,652" samplingRate="44100" startRamp="-51.00 0.00;-36.47 0.20;-28.37 0.30;-23.56 0.40;-18.44 2.60;-17.49 2.70;-12.19 10.30;-11.30 10.40;-6.70 36.10;-4.84 36.20;-2.53 52.40;0.26 282.90;" displayTitle="FLAC (Stereo)" extendedDisplayTitle="FLAC (Stereo)"> </Stream>
<Stream id="343927" key="/library/streams/343927" streamType="4" codec="txt" format="txt" provider="com.plexapp.agents.lyricfind" displayTitle="TXT (External)" extendedDisplayTitle="TXT (External)"> </Stream>
</Part>

```

This seems to have solved it, so my question is now:

1. How can I have deep analysis run when a new file is added to a library
2. Why are my specific .flacs needing a deep analysis and this metadata where as other .flacs work immediately after adding them to the library

I’d like to avoid needing to wait overnight for a new file to be playable.

---

<div class="post-metadata">

### Author: ![jjross](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/jjross/32/5936_2.png) [@jjross](https://forums.plex.tv/u/jjross)
#### Post date: [January 26, 2022, 5:30am UTC](https://forums.plex.tv/t/playing-flac-files-to-sonos/772783/5 "2022-01-26T05:30:48Z")

</div>

I think you can force it to run when a track is added by changing the “ Analyze audio tracks for loudness” and “Analyze audio tracks for sonic features” to “as a scheduled task and when media is added” under “settings, library”.

---

<div class="post-metadata">

### Author: ![AgentWhite](https://avatars.discourse-cdn.com/v4/letter/a/71c47a/32.png) [@AgentWhite](https://forums.plex.tv/u/AgentWhite)
#### Post date: [January 28, 2022, 1:11am UTC](https://forums.plex.tv/t/playing-flac-files-to-sonos/772783/6 "2022-01-28T01:11:24Z")

</div>

Thanks, I have since set those. Looks to be a solution.

As a side note I had upgraded PMS to latest version = 1.25.3.5409 and the problem still exists. Reading the patch notes back from my previous version I saw a lot of fixes related to scanning Music so was hopeful it was fixed, but was not.

---

<div class="post-metadata">

### Author: ![system](https://global.discourse-cdn.com/plex/original/3X/2/a/2acb9765406f63293d357b4ec509ec39aa28f2ad.png) [@system](https://forums.plex.tv/u/system)
#### Post date: [April 28, 2022, 1:12am UTC](https://forums.plex.tv/t/playing-flac-files-to-sonos/772783/7 "2022-04-28T01:12:09Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
