我一直在尝试进入 pygame,我想播放声音。我尝试像这样启动混音器模块:
<!DOCTYPE html>
<html>
<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/tinysort/2.2.2/tinysort.min.js">
</script>
<title></title>
</head>
<body>
<div class="slick-slider">
<ul class="your-class list">
<li class="slide">
<h3>Customer Success</h3><span class="careerscount" id="customersuccessslidecount">1</span> open roles
</li>
<li class="slide">
<h3>Engineering</h3><span class="careerscount" id="engineeringslidecount">1</span> open roles
</li>
<li class="slide">
<h3>Finance</h3><span class="careerscount" id="financeslidecount">12</span> open roles
</li>
<li class="slide">
<h3 class="name">Insurance</h3><span class="careerscount" id="insuranceslidecount">0</span> open roles
</li>
<li class="slide">
<h3 class="name">Marketing</h3><span class="careerscount" id="marketingslidecount">0</span> open roles
</li>
<li class="slide">
<h3>People</h3><span class="careerscount" id="peopleslidecount">0</span> open roles
</li>
<li class="slide">
<h3>Operations</h3><span class="careerscount" id="operationsslidecount">4</span> open roles
</li>
<li class="slide">
<h3>Product</h3><span class="careerscount" id="productslidecount">9</span> open roles
</li>
<li class="slide">
<h3>Referencing</h3><span class="careerscount" id="referencingslidecount">3</span> open roles
</li>
<li class="slide">
<h3>Sales</h3><span class="careerscount" id="salesslidecount">0</span> open roles
</li>
<li class="slide">
<h3>Support</h3><span class="careerscount" id="supportslidecount">8</span> open roles
</li>
</ul>
</div>
<script>
window.onload = function() {
tinysort('li.slide', 'span.careerscount', {
order: 'desc',
emptyEnd: false
});
};
</script>
</body>
</html>
当我运行它时,它给出了这个错误:
import pygame
import time
pygame.init()
pygame.mixer.init()
我正在 repl.it 上运行代码,但我不确定它的 repl 是否有问题,因为它导致在默认 IDLE 上完美运行的代码出现问题。
答案 0 :(得分:-1)
pygame.mixer 无法在 repl.it 上运行,因为它没有关联的音频设备
正如你所说,它适用于空闲。这是因为您的设备有音频设备