{"published":"2022-12-15 20:54:10","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fbaba-s.hatenablog.com%2Fentry%2F2022%2F12%2F15%2F205410\" title=\"\u3010Python\u3011.ogg \u306e\u6700\u521d\u3068\u6700\u5f8c\u306e\u7121\u97f3\u90e8\u5206\u3092\u524a\u9664\u3059\u308b\u65b9\u6cd5 - \u30b3\u30ac\u30cd\u30d6\u30ed\u30b0\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","author_url":"https://blog.hatena.ne.jp/baba_s/","blog_url":"https://baba-s.hatenablog.com/","image_url":null,"author_name":"baba_s","version":"1.0","provider_url":"https://hatena.blog","provider_name":"Hatena Blog","categories":["\u305d\u306e\u4ed6","\u305d\u306e\u4ed6 - Python"],"url":"https://baba-s.hatenablog.com/entry/2022/12/15/205410","type":"rich","title":"\u3010Python\u3011.ogg \u306e\u6700\u521d\u3068\u6700\u5f8c\u306e\u7121\u97f3\u90e8\u5206\u3092\u524a\u9664\u3059\u308b\u65b9\u6cd5","description":"\u6982\u8981 import librosa import soundfile as sf path = \"input.ogg\" y, sr = librosa.load(path, sr=None, mono=False) yt, index = librosa.effects.trim(y, top_db=60) sf.write(\"output.ogg\", yt.T, sr) pip install librosa \u3067 librosa \u3092\u5165\u624b\u3057\u3066\u304a\u304f pip install soundfile \u3067 soundfile \u3092\u5165\u624b\u3057\u3066\u304a\u304f sr=None \u3092\u6307\u5b9a\u3059\u308b\u3068\u5143\u306e\u30b5\u30f3\u30d7\u30ea\u30f3\u30b0\u5468\u6ce2\u6570\u306e\u307e\u307e\u8aad\u307f\u8fbc\u307e\u2026","width":"100%","blog_title":"\u30b3\u30ac\u30cd\u30d6\u30ed\u30b0","height":"190"}