{
  "id": 162540,
  "title": "Missing sampling rate for one mp3 file",
  "url": "/competitions/birdsong-recognition/discussion/162540",
  "author_name": "",
  "post_date": "2020-06-29T09:01:52.482440500Z",
  "votes": 3,
  "comment_count": 3,
  "views": 0,
  "content": "<p>Hi, I just faced with an error for XC195038.mp3 file in lotduc folder. I got error as division by zero so I checked the file and found that it has no sampling rate even though the file is working properly. I don't know if there are more files in the dataset like this but it would be useful if you load the file in a try-except block.</p>\n\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F3130748%2Fa4e5fd5d05a16ffdd656351ed5db0350%2FScreenshot_1.png?generation=1593421095677785&amp;alt=media\" alt=\"\"></p>",
  "messages": [
    {
      "id": "906396",
      "postDate": "06/29/2020 09:01:52",
      "content": "<p>Hi, I just faced with an error for XC195038.mp3 file in lotduc folder. I got error as division by zero so I checked the file and found that it has no sampling rate even though the file is working properly. I don't know if there are more files in the dataset like this but it would be useful if you load the file in a try-except block.</p>\n\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F3130748%2Fa4e5fd5d05a16ffdd656351ed5db0350%2FScreenshot_1.png?generation=1593421095677785&amp;alt=media\" alt=\"\"></p>",
      "rawMarkdown": "Hi, I just faced with an error for XC195038.mp3 file in lotduc folder. I got error as division by zero so I checked the file and found that it has no sampling rate even though the file is working properly. I don't know if there are more files in the dataset like this but it would be useful if you load the file in a try-except block.\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F3130748%2Fa4e5fd5d05a16ffdd656351ed5db0350%2FScreenshot_1.png?generation=1593421095677785&amp;alt=media)",
      "votes": null
    },
    {
      "id": "906801",
      "postDate": "06/29/2020 14:43:35",
      "content": "<p>I did run into the same problem and solved this by adding a column to the train audio with the sample rate as integers. The sampling rates are already given in the train csv in the *sampling_rate* column, but as a string and not as an integer. When processing a file do not use the sample rate returned by librosa but the sample rate from the train csv.\nThe sample rates can be obtained with the following line of code:</p>\n\n<p><code>srs = train.sampling_rate.apply(lambda sr: int(sr.split(' ')[0])).astype(np.uint16)</code></p>",
      "rawMarkdown": "I did run into the same problem and solved this by adding a column to the train audio with the sample rate as integers. The sampling rates are already given in the train csv in the *sampling_rate* column, but as a string and not as an integer. When processing a file do not use the sample rate returned by librosa but the sample rate from the train csv.\nThe sample rates can be obtained with the following line of code:\n\n```srs = train.sampling_rate.apply(lambda sr: int(sr.split(' ')[0])).astype(np.uint16)```",
      "votes": null
    },
    {
      "id": "938225",
      "postDate": "07/21/2020 12:12:51",
      "content": "<p>am I missing something....?\nI used the sampling error prescribed in the train df... and I am still facing the same issue...!</p>\n\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F87729%2F74b7cf1add460737f7cb88b026677f03%2Fsampling%20error.png?generation=1595333620635795&amp;alt=media\" alt=\"\"></p>",
      "rawMarkdown": "am I missing something....?\nI used the sampling error prescribed in the train df... and I am still facing the same issue...!\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F87729%2F74b7cf1add460737f7cb88b026677f03%2Fsampling%20error.png?generation=1595333620635795&amp;alt=media)",
      "votes": null
    },
    {
      "id": "938289",
      "postDate": "07/21/2020 12:40:37",
      "content": "<p>This was fixed ...\nas outlined by <a href=\"/teppeisudo\">@teppeisudo</a>  in this topic <code>https://www.kaggle.com/c/birdsong-recognition/discussion/162970</code>\nuse sr = None while loading the MP3</p>",
      "rawMarkdown": "This was fixed ...\nas outlined by @teppeisudo  in this topic `https://www.kaggle.com/c/birdsong-recognition/discussion/162970`\nuse sr = None while loading the MP3",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 906801,
      "author_name": "markwijkhuizen",
      "author_url": "",
      "post_date": "06/29/2020 14:43:35",
      "content": "<p>I did run into the same problem and solved this by adding a column to the train audio with the sample rate as integers. The sampling rates are already given in the train csv in the *sampling_rate* column, but as a string and not as an integer. When processing a file do not use the sample rate returned by librosa but the sample rate from the train csv.\nThe sample rates can be obtained with the following line of code:</p>\n\n<p><code>srs = train.sampling_rate.apply(lambda sr: int(sr.split(' ')[0])).astype(np.uint16)</code></p>",
      "votes": null,
      "replies": [
        {
          "id": 938225,
          "author_name": "ronyroy",
          "author_url": "",
          "post_date": "07/21/2020 12:12:51",
          "content": "<p>am I missing something....?\nI used the sampling error prescribed in the train df... and I am still facing the same issue...!</p>\n\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F87729%2F74b7cf1add460737f7cb88b026677f03%2Fsampling%20error.png?generation=1595333620635795&amp;alt=media\" alt=\"\"></p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 938289,
          "author_name": "ronyroy",
          "author_url": "",
          "post_date": "07/21/2020 12:40:37",
          "content": "<p>This was fixed ...\nas outlined by <a href=\"/teppeisudo\">@teppeisudo</a>  in this topic <code>https://www.kaggle.com/c/birdsong-recognition/discussion/162970</code>\nuse sr = None while loading the MP3</p>",
          "votes": null,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "906396": "Hi, I just faced with an error for XC195038.mp3 file in lotduc folder. I got error as division by zero so I checked the file and found that it has no sampling rate even though the file is working properly. I don't know if there are more files in the dataset like this but it would be useful if you load the file in a try-except block.\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F3130748%2Fa4e5fd5d05a16ffdd656351ed5db0350%2FScreenshot_1.png?generation=1593421095677785&amp;alt=media)",
    "906801": "I did run into the same problem and solved this by adding a column to the train audio with the sample rate as integers. The sampling rates are already given in the train csv in the *sampling_rate* column, but as a string and not as an integer. When processing a file do not use the sample rate returned by librosa but the sample rate from the train csv.\nThe sample rates can be obtained with the following line of code:\n\n```srs = train.sampling_rate.apply(lambda sr: int(sr.split(' ')[0])).astype(np.uint16)```",
    "938225": "am I missing something....?\nI used the sampling error prescribed in the train df... and I am still facing the same issue...!\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F87729%2F74b7cf1add460737f7cb88b026677f03%2Fsampling%20error.png?generation=1595333620635795&amp;alt=media)",
    "938289": "This was fixed ...\nas outlined by @teppeisudo  in this topic `https://www.kaggle.com/c/birdsong-recognition/discussion/162970`\nuse sr = None while loading the MP3"
  },
  "source": "meta"
}