一些HTML5画布演示非常令人印象深刻,但我有点困惑.canvas元素可以做什么常规的旧JS/jQuery和CSS3/HTML5不能?有性能优势吗?
使用Cython作为游戏的主要编程语言有多实用?
我是一名经验丰富的Python程序员,我非常喜欢它,但对于游戏编程而言,我确实是个新手.我知道通常认为Python太慢而无法进行任何严肃的游戏编程,这就是为什么Cython对我很有趣.使用Cython,我可以使用类似Python的语言,速度为C.
我知道我可能还需要学习一些C/C++,但看起来Cython会比较加快开发时间.
那么,它实用吗?我还能使用OpenGL,OpenAL和Bullet Physics等C/C++库吗?
我有一个Windows应用程序,需要使用端口50005,50006但是被阻止了。
运行时,我看到以下内容netsh int ip show excludedportrange protocol=tcp:
Protocol tcp Port Exclusion Ranges
Start Port End Port
---------- --------
5357 5357
49709 49808
49809 49908
49909 50008
50009 50108
50109 50208
50280 50379
* - Administered port exclusions.
Run Code Online (Sandbox Code Playgroud)
所以,我的机器上的东西是预留的端口49909来50008,这大概是什么原因造成我的应用程序失败。我尝试excludedportrange使用以下命令删除它:
netsh int ip delete excludedportrange protocol=tcp numberofports=100 startport=49909
Run Code Online (Sandbox Code Playgroud)
但是我看到一个错误Access is denied.,这使我认为保留该端口的任何内容都在积极运行,但是我不知道这可能是什么。
同样奇怪的是,即使我看到一个错误,在运行该命令后,如果重新启动,情况excludedportrange也会有所不同。
作为健全性检查,我还运行resmon.exe并确认端口50005和上没有任何运行50006。
我如何知道添加了excludedportrange什么?
编辑:我已经缩小到Hyper-V。如果禁用Hyper-V,则不会排除这些端口。
我知道这里有一些类似的问题,但大多数都是关于生成波形图像,这不是我想要的。
我的目标是为音频文件生成波形可视化,类似于 SoundCloud,但不是图像。我希望获得数组中音频剪辑每秒(或半秒)的最大幅度数据。然后我可以使用这些数据创建基于 CSS 的可视化。
理想情况下,我希望获得一个数组,其中包含每秒的所有幅度值作为整个音频文件最大幅度的百分比。这是一个例子:
[
0.0, # Relative max amplitude of first second of audio clip (0%)
0.04, # Relative max amplitude of second second of audio clip (4%)
0.15, # Relative max amplitude of third second of audio clip (15%)
# Some more
1.0, # The highest amplitude of the whole audio clip will be 1.0 (100%)
]
Run Code Online (Sandbox Code Playgroud)
我想我至少必须使用numpyPython 的wave模块,但我不知道如何获取我想要的数据。我想使用 Python,但我并不完全反对使用某种命令行工具。
我需要使用Python 2.4.4将XML转换为Python字典和从Python字典转换XML.我只需要节点名称和值,我不担心属性,因为我正在解析的XML没有任何属性.我无法使用,ElementTree因为2.4.4不可用,因为我的工作环境,我无法使用第三方库.对我来说最简单的方法是什么?有什么好的片段吗?
此外,如果没有一种简单的方法可以做到这一点,那么Python 2.4.4是否有本机支持的替代序列化格式?
这是我试图复制的命令:
gst-launch filesrc location=test.flac ! flacdec ! lame ! filesink location=test.mp3
Run Code Online (Sandbox Code Playgroud)
当我运行此命令时,它工作得很漂亮.我试图使用Pythong绑定来复制它,但根本没有运气.我不会在这些脚本中出现任何错误,但它们无法按预期工作:
当我运行这个脚本时,我只得到一个空的MP3文件:
import gst
pipeline = gst.parse_launch('filesrc location="test.flac" ! flacdec ! lame ! filesink location="test.mp3"')
pipeline.set_state(gst.STATE_PLAYING)
Run Code Online (Sandbox Code Playgroud)
当我运行这个脚本时,我得到一个损坏的MP3文件:
import gst
converter = gst.Pipeline('converter')
source = gst.element_factory_make('filesrc', 'file-source')
source.set_property('location', 'test.flac')
decoder = gst.element_factory_make('flacdec', 'decoder')
encoder = gst.element_factory_make('lame', 'encoder')
sink = gst.element_factory_make('filesink', 'sink')
sink.set_property('location', 'test.mp3')
converter.add(source, decoder, encoder, sink)
source.link(sink)
converter.set_state(gst.STATE_PLAYING)
Run Code Online (Sandbox Code Playgroud)
谁知道我做错了什么?
python ×5
audio ×2
javascript ×2
amplitude ×1
c ×1
canvas ×1
cython ×1
django ×1
gstreamer ×1
gwt ×1
html5 ×1
java ×1
netsh ×1
networking ×1
port ×1
python-2.4 ×1
soundcloud ×1
tcp ×1
testing ×1
unit-testing ×1
waveform ×1
windows ×1
xml ×1