$ _GET显示空值($_GET shows empty value)
我有一个
test.php
,我有下面的代码<?php if(isset($_GET['p']) or $_GET['p'] != null) { echo $_GET['p']; } else { echo "Not found"; } ?>
我列出了下面的URL,然后需要输出显示
Test 1 : http://localhost/example/test.php output : Notice: Undefined index: p in R:\xampp\htdocs\example\test.php on line 3 Not found Test 2 : http://localhost/example/test.php?p output : blank page Test 3 : http://localhost/example/test.php?p= output : blank page Test 4 : http://localhost/example/test.php?p=1 output : 1
我接受
Test 1
和Test 2
是true
但是当Test 2
和Test 3
失败了解决方案。I have a
test.php
and i have the below code<?php if(isset($_GET['p']) or $_GET['p'] != null) { echo $_GET['p']; } else { echo "Not found"; } ?>
I have listed out below urls then required output are show
Test 1 : http://localhost/example/test.php output : Notice: Undefined index: p in R:\xampp\htdocs\example\test.php on line 3 Not found Test 2 : http://localhost/example/test.php?p output : blank page Test 3 : http://localhost/example/test.php?p= output : blank page Test 4 : http://localhost/example/test.php?p=1 output : 1
I accept that
Test 1
andTest 2
aretrue
But whenTest 2
andTest 3
fails out the solution.
原文:https://stackoverflow.com/questions/10207796
最满意答案
您首先需要
#import
CAAUParameter和AUParamInfo(可以在/ Developer / Extras / CoreAudio / PublicUtility中找到)。编辑 :现在可以在“Audio Tools For Xcode”包中找到这些文件。 您可以通过访问Xcode> Open Developer Tool>更多开发人员工具来获取它...
假设您有一个名为
theUnit
以下代码将设置您迭代theUnit
的参数:bool includeExpert = false; bool includeReadOnly = false; AUParamInfo info (theUnit, includeExpert, includeReadOnly); for(int i = 0; i < info.NumParams(); i++) { if(NULL != info.GetParamInfo(i)) { // Do things with info here } }
例如,
info.GetParamInfo(i))->ParamInfo()
将为您提供一个AudioUnitParameterInfo结构,其定义如下:typedef struct AudioUnitParameterInfo { char name[52]; CFStringRef unitName; UInt32 clumpID; CFStringRef cfNameString; AudioUnitParameterUnit unit; AudioUnitParameterValue minValue; AudioUnitParameterValue maxValue; AudioUnitParameterValue defaultValue; UInt32 flags; } AudioUnitParameterInfo;
请注意,您首先需要打开AudioUnit(例如,通过在包含该单元的Graph上调用AUGraphOpen())。
You'll first need to
#import
CAAUParameter and AUParamInfo (which can be found in /Developer/Extras/CoreAudio/PublicUtility).EDIT: These files are now found in the "Audio Tools For Xcode" package. You can get it by going to Xcode > Open Developer Tool > More Developer Tools...
Assuming you have an AudioUnit called
theUnit
The following code will set you up to iterate throughtheUnit
's parameters:bool includeExpert = false; bool includeReadOnly = false; AUParamInfo info (theUnit, includeExpert, includeReadOnly); for(int i = 0; i < info.NumParams(); i++) { if(NULL != info.GetParamInfo(i)) { // Do things with info here } }
For example,
info.GetParamInfo(i))->ParamInfo()
will give you an AudioUnitParameterInfo struct which is defined as follows:typedef struct AudioUnitParameterInfo { char name[52]; CFStringRef unitName; UInt32 clumpID; CFStringRef cfNameString; AudioUnitParameterUnit unit; AudioUnitParameterValue minValue; AudioUnitParameterValue maxValue; AudioUnitParameterValue defaultValue; UInt32 flags; } AudioUnitParameterInfo;
Note that you'll need to open the AudioUnit first (eg. by calling AUGraphOpen() on the Graph which contains the unit).
相关问答
更多-
如何托管苹果公司的Pitch Shift Audio Unit插件等(How to Host Apple's Pitch Shift Audio Unit plugin and the like)[2023-05-24]
我终于弄明白了。 参数值栏是拥有音频单元视图的窗口的子窗口。 为了解决这个问题,我在NSApplication的子类中捕获了窗口的鼠标移动事件,然后关闭子窗口(aka值栏),以便它们不停留在屏幕上。 这并没有阻止退出不良访问。 我现在认为这是一个单独的问题,只是似乎与这些徘徊的儿童窗口有关。 I finally figured it out. The parameter value bars are child windows of the window that owns the audio unit v ... -
这里有一些非常好的资源( http://michael.tyson.id.au/2008/11/04/using-remoteio-audio-unit/ )用于使用RemoteIO音频单元。 根据我在iPhone上使用音频单元的经验,我发现我可以在回调函数中手动实现转换。 这样做,你可能会发现解决你的问题。 There are some very good resources here (http://michael.tyson.id.au/2008/11/04/using-remoteio-audio- ...
-
您首先需要#import CAAUParameter和AUParamInfo( 可以在/ Developer / Extras / CoreAudio / PublicUtility中找到 )。 编辑 :现在可以在“Audio Tools For Xcode”包中找到这些文件。 您可以通过访问Xcode> Open Developer Tool>更多开发人员工具来获取它... 假设您有一个名为theUnit以下代码将设置您迭代theUnit的参数: bool includeExpert = false; ...
-
我最终使用Core Audio与The Amazing Audio Engine + Audio Units一起实现压缩限制器: http : //theamazingaudioengine.com/ 这个解决方案虽然不易实现,但似乎完美无缺。 I ended up using Core Audio to implement the compressor limiter together with The Amazing Audio Engine + Audio Units: http://theamazi ...
-
我能够通过从文件播放器的输出范围获取流格式并将其分配给varispeed单元的输出范围来解决我的问题。 //Setup a container ASBD, and zero out it's defaults AudioStreamBasicDescription asbd; memset(&asbd, 0, sizeof(AudioStreamBasicDescription)); //Get the size of the ASBD for the get property function UInt ...
-
解决方案是在每个枚举之前添加注释。 这些注释会自动转换为枚举描述列。
... -
当你改变延迟时,总会有某种失真。 这只是挑选你想要的东西。 正如您所发现的,如果您只是进入一个随机点,从一个样本值到下一个样本值的急剧跳跃通常会导致听得见的声音。 一种选择是简单地将音频静音一小段时间并再次启动。 如果这仍然太突然,您可以在几毫秒内将值缩小到零,并在几毫秒内将它们重新缩放到新的缓冲区位置。 (有效地快速降低音量,然后在你处于新位置时备份。) Propellerhead的原因实际上是模拟加速和减慢录音速度,好像它是一个磁带延迟,你正在移动头部。 这非常复杂......您有效地重新采样缓冲区音频 ...
-
不会为独立方法生成RTTI。 希望这将在以后的版本中修复,(他们可能需要TRttiUnit类型来执行此操作),但是现在它不可用。 No. RTTI is not generated for standalone methods. Hopefully this will be fixed in a later version, (they'd probably need a TRttiUnit type to do that,) but for now it's not available.
-
Resharper中NUnit测试的显示不由NUnit处理,而是由Resharper团队编写的测试适配器处理。 NUnit使描述可用,所以如果Resharper测试运行器被修改,Resharper可以显示信息。 The display of NUnit tests within Resharper is not handled by NUnit, but by the test adapter that the Resharper team wrote. NUnit makes the descriptio ...
-
RemoteIO是因为它是最低级别的界面。 我的缓冲区大小为512帧,在44.1kHz时大约为11ms。 RemoteIO is because it's the lowest level interface. My buffer size is 512 frames, which at 44.1kHz is about 11ms.